Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am not sure how to word the subject or the question.
In the code below I am iterating thru a range to test conditions. My problem is the range will vary all the time. It will always start in "C5" and the rows/Coulumns will always vary. In this code "Set rRngCol = Range("C5", Range("g" & Rows.Count).End(xlUp)) 'when finds empty cell, program ends?" I am setting a fixed range, how can I make the range a variable dependant on any worksheet? (I have the worksheet iteration completed, just working out the cell iterations). Begin code=================== Sub test3() Dim Dif As Long Dim rRngCol As Range Dim i As Range 'range of cells Dim sEmpName As String 'for Employee name in column A 'i.Address is cell address. example "C5" Set rRngCol = Range("C5", Range("g" & Rows.Count).End(xlUp)) 'when finds empty cell, program ends? For Each i In rRngCol If IsDate(i) = True Then Dif = Date - i If Dif "365" Then MsgBox i & " 1+ year" & " " & i.Address & " " & sName Else If Dif "302" Then MsgBox i & " 10+ months" & " " & i.Address Else End If End If End If NextCell: Next i End Sub End code======================= -- Regards Rick XP Pro Office 2007 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ignore blank cells in a named range when using dependent data validation | Excel Discussion (Misc queries) | |||
Ignore Blank Cells | Excel Programming | |||
find range of non-blank cells in colum | Excel Programming | |||
Running a macro if any data is entered in a range of cells | Excel Worksheet Functions | |||
Blank cells in named range- how to ignore them when making my graph? Help plz! | Excel Discussion (Misc queries) |