Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excellent, all is working now! I did have to make a change to the
column and row indicators (r.Row - 3 and r.Column - 2) to get it to work correctly. I have no idea why this is the case, I just messed around with it until it worked. In any case, THANKS MARTIN!!! The new code is below......... Sub Reconcile() Dim sh As Worksheet Dim r As Range, rng As Range Dim i As Integer i = 1 Set rng = Selection ' get the selected range Set sh = ActiveWorkbook.Sheets.Add ' add a new sheet For Each r In rng 'iterate through all cells of rng If r.Value = "" Then 'check if cell is empty sh.Cells(i, 1).Value = rng(r.Row - 3, 0).Value ' write the cell value at left of range in col1 sh.Cells(i, 2).Value = rng(0, r.Column - 2).Value ' write the cell value at top of range to col2 i = i + 1 'goto next row End If Next r End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking for all blank cells in a range orcolumn. | Excel Programming | |||
Checking to See if Range Values Add up to 100 | Excel Programming | |||
Checking ALL values in a range | Excel Discussion (Misc queries) | |||
checking if worksheet is blank | Excel Programming | |||
Checking if worksheet is blank | Excel Programming |