View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DKY[_60_] DKY[_60_] is offline
external usenet poster
 
Posts: 1
Default Problems with For Each


I have the code below but it gives me an error and tells me to defin
the variable 'cell' in the For Each cell In Selection part. Why is i
doing that?


Code
-------------------
LRow = Cells(Rows.Count, "E").End(xlUp).Row
Range("A2:A" & LRow).Select
' START CHANGE NUMBER TO TEXT
For Each cell In Selection
cell.NumberFormat = "@"
cell.Value = Trim(cell.Value)

' If cell.Value < "" Then
' TempString = Trim(UCase(cell.Value))
' cell.Value = TempString
' End If
Next cel
-------------------

--
DK
-----------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...fo&userid=1451
View this thread: http://www.excelforum.com/showthread.php?threadid=39345