Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the code below I am able to see the cell.address of cells with values
(true) and cells without values (false). Of this I can't seem to capture when the last empty cell occured so I can set a range of first cell with a value and last cell without a value. As an example (Column A only); row1 would be true, then row 5 would be true all rows in between would be false. How can I get the range of row 1 thru row 4? I initially thought I would get the address of the last cell before finding a cell that is true again. So much for that theory. '====== Sub RowCount() lrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row ' count used rows in Column A For Each c In ActiveSheet.Range("A3:A" & lrow) If c < "" Then 'if "c" is something get cell address vNameCellAddress = c.Address 'get cell address of cell with a value MsgBox "True" & " " & vNameCellAddress 'for testing End If If c = "" Then vEmptyCellAddress = c.Address 'get cell address of cell with a value MsgBox "False" & " " & vEmptyCellAddress 'for testing End If MsgBox vNameCellAddress & " " & vEmptyCellAddress Next End Sub '====== Thanks in advance -- Regards VBA.Noob.Confused XP Pro Office 2007 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
(Complex) Loop within loop to create worksheets | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming |