View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default (in)definite article and leading/trailing space remover needed

Also - if you use the macro - you should change the For Each line to

For Each x In Intersect(Selection, Selection.Parent.UsedRange)

that way - it doesn't waste time looping through cells that are not used
anyway.



"KHashmi316" wrote:


JMB Wrote:
when you paste the code into a module, make sure this line appears on
one
line. when i posted it got wrapped to the next line (and it's not
supposed
to be).

If (UCase(Left(x.Value, InStr(1, x.Value, " ", vbTextCompare) - 1)) =
UCase(y)) _


Thx for helping out.

I tried to run this but keep running into 'Variable not defined' error
for "x" in this line:

For Each x In Selection

Any clues?



--
KHashmi316


------------------------------------------------------------------------
KHashmi316's Profile: http://www.excelforum.com/member.php...o&userid=10439
View this thread: http://www.excelforum.com/showthread...hreadid=378854