Finding Next Empty Cell in a Range
I have used JLatham's program to consider the number of days each month.
best regards,
Gabor Sebo
"Stilltrader47" wrote in message
..
-----------------------------------------------------------------------------------------------------------
'JLatham's program expanded 4/17/2010
'TABLE IN B2: AF13
Sub FindFirstEmptyCell()
Dim RP As Integer
Dim CP As Integer
Dim seekRange As Range
Dim anyCell As Range
Dim exitFlag As Boolean
Set seekRange = ActiveSheet.Range("B2:AF13") ' 12 x 31
'this just gets the first empty cell it finds
'pretty much a search by row
For Each anyCell In seekRange
If IsEmpty(anyCell) Then
'MsgBox "Empty cell at " & anyCell.Address
anyCell.Select
m = anyCell.Address
If m = "$AD$3" Or m = "$AE$3" Or m = "$AF$3" Or m = "$AF$5" Or m =
"$AF$7" Or m = "$AF$10" Or m = "$AF$12" Then
' MsgBox "NONO" & m
' MsgBox " Caught"
GoTo rest
End If
Exit For
End If
rest:
Next
'
'this searches left-to-right then down
'results should be same as above
End Sub
"Stilltrader47" wrote in message
...
|