Macro:Move up 2 rows to 1st non-blank cell, add 1


Posted by Jonn on March 11, 2001 7:44 PM

Please help with macro that will move up two rows, to the first non-blank cell and add 1 to the number in that cell.
Thank You. Jonn

Posted by Dave Hawley on March 11, 2001 9:41 PM

Hi John

This will add 1 to the first non blank cell above the selected cell.


Sub TryThis()
Dim Cell As Range
If Selection.Row = 1 Then Exit Sub
Set Cell = Selection.End(xlUp)
If Not IsNumeric(Cell) Then Exit Sub
Cell = Cell + 1
End Sub

Dave


OzGrid Business Applications



Posted by Jonn on March 12, 2001 8:16 AM

Thanks Dave!