simoncpage
Programmer
I need a function that returns the first empty cell of a specific row. I have tried using Instr() to locate a cell with "" in but the cells in that row contain nulls anyway so that doesn't work. I have a function that find the last cell but im not sure how to alter it for a specific row?
any Help?? would be great
-------------------------------------------
Function findlastreviewscol(Column As String)
Dim maxrow As Integer, maxcolumn As Integer
maxrow = 1
maxcolumn = 1
For Each cell In Intersect(ActiveSheet.Range("" & Column & ":" & Column & "", ActiveSheet.UsedRange)
If cell.Text <> "" Then
If cell.Row > maxrow Then
maxrow = cell.Row
End If
If cell.Column > maxcolumn Then
maxcolumn = cell.Column
End If
End If
Next cell
findlastreviewscol = maxcolumn
End Function
----------------------------------
thanks
any Help?? would be great
-------------------------------------------
Function findlastreviewscol(Column As String)
Dim maxrow As Integer, maxcolumn As Integer
maxrow = 1
maxcolumn = 1
For Each cell In Intersect(ActiveSheet.Range("" & Column & ":" & Column & "", ActiveSheet.UsedRange)
If cell.Text <> "" Then
If cell.Row > maxrow Then
maxrow = cell.Row
End If
If cell.Column > maxcolumn Then
maxcolumn = cell.Column
End If
End If
Next cell
findlastreviewscol = maxcolumn
End Function
----------------------------------
thanks