The question I have involves the placement of inserting a textbox. For example, rather than specifying a place in the spreadsheet by 'points' via the left and/or top property of the AddTextBox method, is it possible to place the textbox a row or two below the last row with data?
I have this written to find the last row w/ data, which may not be totally correct
Is there anyway to follow up that function to include adding a textbox after it rather than specifying a 'static' location?
Thanks!
I have this written to find the last row w/ data, which may not be totally correct
Code:
Function LastRowIndex(ByVal w as Worksheet, ByVal col as Variant) as Long
Dim r as Range
Set r = Application.Intersect(w.UsedRange, w.Columns(col))
If Not r is Nothing Then
Set r = r.cells(r.Cells.count)
If IsEmpty(r.Value) Then
LastRowIndex = r.End(xlUp).row
Else
LastRowIndex = r.row
End If
End If
End Function
Thanks!