How To Detect Leading Or Trailing Apostrophe And Quote Characters
Jun 23, 2014
I want to alert a user that he or she has typed in a text string that begins or ends with an apostrophe ' or begins or ends with a quotation mark " so that they can take corrective action in removing these characters. The reasons for this are superflous to this post but what I thought was a logical answer returns a formula error. Here's the scenario:-
A user enters a string of text in cell A1.
Cell B1 checks if the text, if any, in A1 begins or ends with a ' or a " and if it does, returns an "Error" message
The formula I've tried in B1 is =IF(OR(LEFT(A1,1)="'",LEFT(A1,1)=""",RIGHT(A1,1)="'",RIGHT(A1,1)=""")),"Error","Ok") but Excel will have none of it.
View 9 Replies
ADVERTISEMENT
Feb 21, 2014
I have a perfectly fine formula but whenever I try and use VBA to enter it for me it adds a leading apostrophe and it ruins the INDEX/MATCH with an RTE 1004.
View 5 Replies
View Related
Feb 19, 2013
Is there a way to clean all of the single leading quote marks from all cells in a sheet?
'Bob
'Tom
'Jerry
to
Bob
Tom
Jerry
I'm importing data and I have several columns to deal with and will never know how many columns/rows are in a sheet.
View 9 Replies
View Related
Nov 23, 2006
I receive a lot of spreadsheets which contain numerical data where each cell has been forced to be text by a leading apostrophe.
how to strip the apostrophe out so I can process the data, please?
I know the apostrophe is a hidden character, so I can't use Find & Replace, and using MID or RIGHT doesn't seem to work, either, even if I Copy and Paste Special as Values.
Is there an alternative to manually editing every single cell?
View 4 Replies
View Related
May 17, 2007
formula to strip apostrophe for lookup formula to recognize text as a number.
View 9 Replies
View Related
Oct 9, 2009
I am a SAS programmer and often use SAS Proc Export to dump data to Excel. Sometimes the data is an Excel formula, e.g.
=hyperlink("#Sheet1!r1c1","click here")
Because the data is text, what get's put in the cell is '=HYPERLINK("#Sheet1!r1c1","click here") (note leading single quote).
I cannot use the replace function to edit them out, so must hand edit each one out -tedious at best.
View 4 Replies
View Related
Sep 26, 2007
I searched through some pages of old threads but could not find specifically one solution for performing the subject task on text strings in cells.
I have a lot of Excel files which contain both numerical data and text strings where each cell has been forced to have a leading apostrophe appended to the left side of the text strings and numbers.
How can I strip the leading apostrophe out?
I know the apostrophe is a hidden character, so I can't use Find & Replace.
I would like to figure out some VBA so that I could build this into and automate this via a macro I'm working on.
Is there a way to comprehensively do this for all cells containing text and numbers in a worksheet?
View 9 Replies
View Related
Jun 19, 2014
I'm trying to format an Excel 2010 spreadsheet so that I can import it into another application. I need to convert a number to text with four digits and a leading apostrophe - '0000 for example. How do I do this without having to type everything in manually?
View 14 Replies
View Related
Sep 26, 2007
I have a lot of Excel files which contain both numerical data and text strings where each cell has been forced to have a leading apostrophe appended to the left side of the text strings and numbers.
How can I strip the leading apostrophe out?
I know the apostrophe is a hidden character, so I can't use Find & Replace.
I would like to figure out some VBA so that I could build this into and automate this via a macro I'm working on.
Is there a way to comprehensively do this for all cells containing text and numbers in a worksheet?
View 7 Replies
View Related
Jun 4, 2009
I have a spreadsheet with numbers of various lengths.
Sometimes they are preceded with a period and have one at the end as well.
Examples: of their present state
.11110000.111111.000000.
111111.1111111.000000.
100000.000000.0000.110001.
Examples: of desired state
10000.111111.000000
111111.1111111.000000
100000.000000.0000.110001
Is their a way I can create a new column and insert a formula, then drag it down so that it will delete the first or last character, if the character is a period?
View 6 Replies
View Related
Dec 5, 2013
Any easy way to remove all spaces from a cell, both leading and trailing? I find it hard to believe that Excel doesn't have this functionality. I don't particulary want to write a VBA script since I have never done it but if that's the only way, I'd love to know how to write it. I have looked everywhere but obviously not in the right places.
View 4 Replies
View Related
Feb 13, 2009
I asked this along time ago and received a worksheet formula which suited my needs then. http://www.excelforum.com/excel-work...trailing+zeros
Now I need this in a macro. Below is my current concatenating code.
View 3 Replies
View Related
Mar 31, 2009
I am using the following code to import an excel file into an existing sheet. The problem I am having is the way some of the cells are being imported. Some of the cells have spaces before and after the number.
I need to delete the leading and trailing spaces for each cell affected. Is there a code I can incorporate to do this? BTW…the columns effected are columns F & G.
View 8 Replies
View Related
Jun 10, 2008
to trim leading and trailing spaces from values I'm getting from a For Next routine. I'm using c as my variable and Trim(c.value) as the operation.
There are other routines that search for the explicit string that's the result of the trimmed value and some can't be found because the trim as I'm using it isn't trimming.
View 9 Replies
View Related
Sep 1, 2008
I wrote a tool that people at work use. They initially need to paste in a bunch of customer locations with Address, City, State, Zip, etc. Sometimes the Users have "bad input" data that has non-breaking spaces, multiple space between words, or leading and trailing spaces and nonbreaking spaces. I have code to get rid of all of those problems. However, the Users often use their data for other important functions at work. So I want to give them a message to let them know that their Original Data is "bad".
So instead of just "Fix" . . . I want to "Report the problem", then "Fix". I need to identify exactly what problem was found - not just tell the User that their data is bad.
I wrote a simple Search routine with error handling that identifies 2 of the 4 cases and notifies the User:
Case 1) ASCII 160 (non-breaking space, HTML  
Case 2) multiple spaces (2 or more consecutive spaces)
Case 3) Leading or Trailing Spaces (ASCII 032)
Case 4 Leading or Trailing non-breaking spaces (ASCII 160, which is HTML  )
I cannot quite figure out how to find the 3rd and 4th Cases. If anyone can help me with Case 4 especially, then I can probably do the same thing for Case 3.
I think it will work to somehow use this idea - the code is not even real code but it is just conceptual:
RIGHT(CellReference, 1) = Char(160) or Char(032)
LEFT(CellReference, 1) = Char(160) or Char(032)
Anyway, here is what I have so far . . .
Sub NotifyBadInput
ErrorFlag = False
Cells.Select ' select entire worksheet
' BAD INPUT 1 - lLook for any occurence of ASCII 160 (non-breaking space, HTML  )
' and Notify the User if any of his Input cells contain  's
On Error Goto errormsg1
Selection.Find(What:=" ", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
View 9 Replies
View Related
May 27, 2008
While entering data space is given in the first and last of each cell content. For example
if there is a word Alex Patrix in a cell, space is given before A of alex and after x of Patrix. This is done fo many cells. I want to remove only initial and last space which is un-necessary.
The space caused problem to compare cell so i've to remove space.
I've around 2500 cells with this problem.
View 2 Replies
View Related
Jan 28, 2013
I have 4 columns (and a couple of other text columns) that are formatted as decimal with 6 dicimal points.
I need to create a text file with lines that are 80 bytes each from the spreadsheet - no spaces inbetween each of the characters.
The issue I am having is trying to format the 4 decimal point columns to be fixed numbers and retain the leading or trailing zeros to do a concatenation with the other columns.
Just an example of some what some of the values look like on my spreadsheet:
.123456 | .123450 | .012345 | .012340
Essentially when I'm all said and done, I would like the row to look like "text123456123450012345012340text"
I tried to format 4 new columns as general and use a "=right(cell,6)" and that worked pretty well for the cells that have leading zeros, but for the cells that have trailing zeros, it doesn't seem to pick up the zero. I tried to use a "=mid(cell,2,6)" but that didn't work either.
View 5 Replies
View Related
Jan 27, 2014
I am using Microsoft 2013 and am looking for 4 formulas in order to split 1 cell in to 4 (across same row). Number of characters varies between each instance of """.
I would like the formulas to start in column B-D (data in A)
I am looking at formulas based on specific instances of a quote mark in cell from data in column A
Formula 1 - Return with characters up to and including the 5th instance of """
Formula 2 - Return with characters after 5th """ and up to and including 6th """
Formula 3 - Return with characters after 6th """ and up to and including 7th """
Formula 4 - Return with characters after the 7th instance of """
Example below...
Cell A1
xxyy","aabb","ee,ff,""gghh"hh,"llmm,mmnbijp"oossww"
Desired results
Cell B1 - Formula 1
xxyy","aabb","ee,ff,"
Cell C1 - Formula 2
"gghh"
Cell D1 - Formula 3
hh,"
Cell E1 - Formula 4
mmnbijp"oossww"
View 6 Replies
View Related
Feb 27, 2009
I am trying to create a CSV file to import all of our workers into a payroll software. Unfortunately the list of workers that I have been given to work with has a first and a last name together in one cell. I need to split them into separate cells so the data ends up in the right field in our software. By importing external data and separating the names with the comma as a delimiter, I have ended up with the first name in one cell and the second in another, which is exactly what I need. However, this process also ends up putting a quotation mark in front of the first names in the cells in column A, and a quotation mark after the second name in the cells in column B.
I remember to removing trailing spaces with a macro once, and I am hoping the same theory can be applied to make two macros - one to remove preceding quotation marks, and one to remove trailing quotation marks. The only trouble is, I know no VBA whatsoever, and don't even know how to make a macro unfortunately. Would someone mind letting me know if what I need is possible, and then - literally step by basic step - explain how to make a macro and provide the code to paste into it?
View 2 Replies
View Related
Dec 23, 2009
I have a problem that I just don’t seem to have the brain power to solve right now. I have a list of websites and I need to extract all characters after the last “/” in the URL. URL example:.....
I have been using the find function in conjunction with LEN and RIGHT etc but the multiple instances of “/” is causing headaches for me. Also, the trailing string of characters that I want to extract can be both text or numeric and are of differing lenths.
View 3 Replies
View Related
Jun 11, 2012
I'm scanning data into a spreadsheet using a barcode scanner, but I want the starting character and trailing characters to be removed after I hit enter.
For example...let's say I'm scanning the following text in cell A1:
=W05281212345600
When I hit enter (or the barcode scanner does auto-enter), I want cell A1 to read:
W052812123456
I will always want the "=" and the last two zeros removed from the 16 character number, leaving the 13-character number in its place.
I tried using Excel's various truncate functions (LEFT,RIGHT,MID, etc.), but that only places the corrected text in another cell. That would be fine if I could copy that truncated text back over the original text...but that created a loop problem.
View 1 Replies
View Related
Jun 5, 2008
let's say combobox1 has a list of:
apple (KG)
apple (PKT)
apple (BAG)
orange (KG)
Orange (PKT)
Orange (BAG)
and a command button.
Can I make it in a way that when command button detects (kg) in combox1, the caption of commandButton will change to "KG"? if detect (BAG) combobox1, then commandButton is "Bag"?
View 9 Replies
View Related
Mar 18, 2014
I have a spreadsheet I work with which contains a formula that needs to take an item ID letter/number combo, substitute the preceeding letter(s) with leading zeros (if the initial numerical characters are fewer than 5) to make the result return a 5-digit number.
The original ID can be in several possible formats (beside each I will post the desired result):
V7684 07684V366 00366V88 00088V60827 60827VS57871 57871VS67 00067
I have the following formula which works like a charm for all except the last example:
=IF(LEN(K2)>5,(SUBSTITUTE(SUBSTITUTE(K2,"VS","),"V",")),(REPT("0",5-LEN(K2))&(SUBSTITUTE(SUBSTITUTE(K2,"VS","0"),"V","0"))))
If the first 2 characters are letters ("VS") and there are fewer than 5 numerical characters, the formula results in a 4-digit number, rather than 5. Using the above example, VS67 returns 0067 instead of 00067.
P.S. I just tried
=IF(LEN(K2)>5,(SUBSTITUTE(SUBSTITUTE(K2,"VS",""),"V","")),(REPT("0",5-LEN(K2))&(SUBSTITUTE(SUBSTITUTE(K2,"VS","00"),"V","0")))) which only works when there are 3 or fewer numerical characters.
View 6 Replies
View Related
Feb 19, 2009
how to create a macro that:
- In each row, pops up a Warning Dialog Box if the amount of letters in column "J" doesn't match the # defined in column "B"?
- Preferably this would pop up the Dialog Box as soon as the error occurs (so it's always running)
Two Exceptions:
- Does not look at Rows 1 & 2
- Does not look at Rows where column B = 0 or null
View 9 Replies
View Related
Nov 5, 2007
I have a vlookup function that requires the lookup values to be text, and I have a long list of numerical lookups.
My problem is that I need to go through all these numbers one cell at a time and change them to text. I've tried the easy way of highlighting the cells and formatting them to text but it doesn't work
All that works is adding an apostrophe at the beginning of the number which is VERY time consuming.
My question...
What is the apostrophe doing and why can't I do the same by highlighting and formatting as text.
View 9 Replies
View Related
Mar 19, 2009
What I require is the macro code to achieve the following:-
Cells A2, B2 and C2 will be completed manually, however, when a new quotation is required the user must enter a new Control Reference Number in cell E2 and then press the Generate button.
Once pressed the Macro behind the button will generate the following :-
(a) Quote number underneath the last one in column 'A'
(b) Change Ref underneath the last one in column 'B' (this was the ref number input above in E2)
(c) today’s date underneath the last one in column 'C'
(d) a blank Quote Tab i.e. labelled the next number in the sequence i.e. Quote 2, Quote 3 etc which should be created copying the Template Tab
N.B. the total number of Quotes in any one work book should be a maximum of 30 so some form of checking would be required.
View 9 Replies
View Related
May 24, 2012
I need to calculate a quote over 4 years but the first and last years are not full 12 months.
On Row 20 are monthly costs for each year. The start and end date is in Row 3.
I need to find a formula that can calculate ANNUAL TOTAL for the all these year in Row 22 populated automatically, not just manually times the months in each cell.
Here is a sample file.
View 9 Replies
View Related
Sep 18, 2012
I have been using Excel for many years but haven't dived much into using VBA. I believe it holds the answer to my question. I have developed a spreadsheet with 10 tabs that is used for billing customers. I'd like to take it a step further and, on a separate tab, have a quote automatically populated and then be able to be printed. I need for the VBA to scan certain areas in each tab to see if data is present or greater that 1. If there is data present, it would need to list the content of 3 cells (description, quantity, and total cost). I know that I can directly link but it needs to be dynamic and only display/show data that is present (as not all cells will be needed for every client).
View 2 Replies
View Related
Dec 12, 2006
Someone might find this interesting. Inherited a file that need to total columns but almost 50% of the file has cells w/ the single quote tick infront of the number.
Ex '2257894 or '2234. How can one remove those single quotes out of a cell? NOTE: Cell values are not the same length.
View 9 Replies
View Related
Jul 29, 2009
I work in sales and when under target I need to know how much more i need to sell to hit target. e.g
quotes 10 sold 1 currently at 10%
my target is 50%
at the minute i would have to work this out manually
like i need to quote and sell the next 8 to hit the 50% target.
What can i use on excel putting my current quotes and sales and my target in so it gives me the quotes and sales i need to do?
View 9 Replies
View Related