LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default get for loop to go on after blank cell?

I have this code which checks through the cells of a column. When i
finds a value it checks through the cases and if it finds a match i
writes data as specified in the case.

The problem I am having is that when it hits a blank cell it stops.
How can I get it to continue on?


Code
-------------------

Columns("J:J").Select
Dim c As Range
For Each c In Selection
Select Case UCase(c)
Case "LTCOL"
Range("I" & c.Row).Value = "1"
Case "MAJ"
Range("I" & c.Row).Value = "2"
Case "CAPT"
Range("I" & c.Row).Value = "3"
Case "LT"
Range("I" & c.Row).Value = "4"
Case "WO1"
Range("I" & c.Row).Value = "5"
Case "WO2"
Range("I" & c.Row).Value = "6"
Case "SGT"
Range("I" & c.Row).Value = "7"
Case "CPL"
Range("I" & c.Row).Value = "8"
Case "LCPL"
Range("I" & c.Row).Value = "9"
Case "PTE"
Range("I" & c.Row).Value = "10"
Case "APS"
Range("I" & c.Row).Value = "11"
Case ""
Range("I" & c.Row).Value = "12"

Exit For
End Select

Next c

-------------------


--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through last cell/row of used range tkraju via OfficeKB.com Excel Discussion (Misc queries) 1 April 4th 09 04:45 PM
Average Formula to display blank cell if named range is blank Rachael F Excel Worksheet Functions 3 February 22nd 08 05:05 PM
how to get excel to display blank if reference cell blank silent1(not) Excel Worksheet Functions 1 December 2nd 05 02:49 PM
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. QUEST41067 Excel Discussion (Misc queries) 1 January 15th 05 09:29 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"