Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Easy VBA question: range control
I know this sounds easy, but I'm new to VBA and I haven't been able to solve
it successfully: In a VBA IF-THEN-ELSE statement, how do I specify a range that includes column A from cell A2 to the last non-empty column? Here's my existing code: Sub aaaa Column ("A:A").Select For Each cell in Selection If cell.Value 0 Then cell.Offset(0, 1) = "string1" Else cell.Offset(0, 1) = "string2" End If Next Cell End Sub This code works, but fills the entire Offset column, all 65,000+ rows. I only want to to fill the first 1000-1500 rows, depending on how many rows in the worksheet have data. Thanks in advance. -jbb |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hopefully an easy question | Excel Worksheet Functions | |||
*EASY* question 2!! | New Users to Excel | |||
*EASY* question! | New Users to Excel | |||
new user with easy question? not easy for me | New Users to Excel | |||
MultiPage control: Easy question | Excel Programming |