Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Problem Spaces
Hi,
I'm comparing the string values in a column of Dealer Names to those stored in an Array of Dealer Names. My code isn't finding any matches (although there are plenty) & I think it is something to do with this; When debug it & step through, I notice that the value of the string in my array looks something like this; "Joe Bloggs & Sons Ltd" but the variable is returning Dealer names from the column that look something like this; "Joe Bloggs & Sons Ltd " I'm guessing the amount spaces between the last letter of the string & the quotation mark is why no matches are being found. How can I solve this please, "MERRY XMAS EVERYONE ! " :-) |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Problem Spaces
Think I've sorted it. Trim? It worked so I guess it must be the correct
solution? "egibberate" wrote in message ... Hi, I'm comparing the string values in a column of Dealer Names to those stored in an Array of Dealer Names. My code isn't finding any matches (although there are plenty) & I think it is something to do with this; When debug it & step through, I notice that the value of the string in my array looks something like this; "Joe Bloggs & Sons Ltd" but the variable is returning Dealer names from the column that look something like this; "Joe Bloggs & Sons Ltd " I'm guessing the amount spaces between the last letter of the string & the quotation mark is why no matches are being found. How can I solve this please, "MERRY XMAS EVERYONE ! " :-) |
#3
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Problem Spaces
Yep. The VBA Trim function will remove the leading and trailing spaces. If
you ever have any problems w/ extra spaces between the words, such as "Joe Bloggs & Sons Ltd" you could use Application.Trim, which is the excel worksheet function version that removes all extra spaces (not just the leading and trailing spaces like the VBA version). "egibberate" wrote: Think I've sorted it. Trim? It worked so I guess it must be the correct solution? "egibberate" wrote in message ... Hi, I'm comparing the string values in a column of Dealer Names to those stored in an Array of Dealer Names. My code isn't finding any matches (although there are plenty) & I think it is something to do with this; When debug it & step through, I notice that the value of the string in my array looks something like this; "Joe Bloggs & Sons Ltd" but the variable is returning Dealer names from the column that look something like this; "Joe Bloggs & Sons Ltd " I'm guessing the amount spaces between the last letter of the string & the quotation mark is why no matches are being found. How can I solve this please, "MERRY XMAS EVERYONE ! " :-) |
#4
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Problem Spaces
Thanks for your response JMB.
"JMB" wrote in message ... Yep. The VBA Trim function will remove the leading and trailing spaces. If you ever have any problems w/ extra spaces between the words, such as "Joe Bloggs & Sons Ltd" you could use Application.Trim, which is the excel worksheet function version that removes all extra spaces (not just the leading and trailing spaces like the VBA version). "egibberate" wrote: Think I've sorted it. Trim? It worked so I guess it must be the correct solution? "egibberate" wrote in message ... Hi, I'm comparing the string values in a column of Dealer Names to those stored in an Array of Dealer Names. My code isn't finding any matches (although there are plenty) & I think it is something to do with this; When debug it & step through, I notice that the value of the string in my array looks something like this; "Joe Bloggs & Sons Ltd" but the variable is returning Dealer names from the column that look something like this; "Joe Bloggs & Sons Ltd " I'm guessing the amount spaces between the last letter of the string & the quotation mark is why no matches are being found. How can I solve this please, "MERRY XMAS EVERYONE ! " :-) |
#5
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Problem Spaces
The ASAP Utilities add-in, available free at www.asap-utilities.com has
features that are very helpful in cleaning up text.........they can delete unwanted spaces, and other selected characters on demand. Vaya con Dios, chuck, CABGx3 "egibberate" wrote in message ... Think I've sorted it. Trim? It worked so I guess it must be the correct solution? "egibberate" wrote in message ... Hi, I'm comparing the string values in a column of Dealer Names to those stored in an Array of Dealer Names. My code isn't finding any matches (although there are plenty) & I think it is something to do with this; When debug it & step through, I notice that the value of the string in my array looks something like this; "Joe Bloggs & Sons Ltd" but the variable is returning Dealer names from the column that look something like this; "Joe Bloggs & Sons Ltd " I'm guessing the amount spaces between the last letter of the string & the quotation mark is why no matches are being found. How can I solve this please, "MERRY XMAS EVERYONE ! " :-) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing from Excel Sheet Problem | Excel Discussion (Misc queries) | |||
Add spaces for specific fields to paste in | Excel Discussion (Misc queries) | |||
how do I remove empty spaces trailing a text string? | Excel Worksheet Functions | |||
Stripping out imbedded spaces in a cell/row | Excel Worksheet Functions | |||
remove spaces in text in excel | Excel Discussion (Misc queries) |