Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ignoring cells

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
now i need to know how i can ignore blanks, becuase one problem that i have found, which annoys me very much and is sometimes not easy to detect at first is, lets say you have 2 strings, that are supposed to be the same "string" and "string ", but they are not the same because the 2nd instance of string has the space right after it, so is there anyway of saying, take the first string in the cell, and ingnore all blanks so that you only have a set of characters, and find its match, ignoring its blank spaces as well, or is it not possible because the 2nd string has the blanks and you cant tell it ahead of time to ingore that blanks, i was hoping theyre would be a mechanism that would search for strings, ingoring blanks, is there?? thanks
 
The trim() function removes any spaces on the exterior of a text string. If you apply trim() to both strings you are comparing, any spaces will be ignored, e.g.

if trim(String1)=trim(String2) then
msgbox("Found a match!")
end if
Rob
[flowerface]
 
well what if i want to use that function in the activecell
i tried
activecell.formula = "=trim(activecell)"
activecell.formula = "=trim(activecell.value)"
activecell.value = "=trim(activecell)"
activecell.value = "=trim(activecell.txt)"

nothing works, how can i achieve this, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top