G
Guest
Guest
This it a part from an old macro I wrote a while back.
Now trying to get a cell function from it.
' Function to provide # of last line of table
as it is edited (row # needed for % is table)
'----------------------------------------
' ------ Clen (column length -finds last row) ------
Public Function CLen() As Integer
Range("A500").Select ' below max table length
Selection.End(xlUp).Select
CLen = ActiveCell.Row
' **?? number displayed is row last edited !!!
End Function
' -----------------------------
Now the function runs when row is deleted
does not run when row is inserted
How can I set this up so:
1) it runs when table changes size (can be by several ways
usually insert text copy, row insert, delete row)
2) Get correct line number (where function is placed at
end of col A)
Now trying to get a cell function from it.
' Function to provide # of last line of table
as it is edited (row # needed for % is table)
'----------------------------------------
' ------ Clen (column length -finds last row) ------
Public Function CLen() As Integer
Range("A500").Select ' below max table length
Selection.End(xlUp).Select
CLen = ActiveCell.Row
' **?? number displayed is row last edited !!!
End Function
' -----------------------------
Now the function runs when row is deleted
does not run when row is inserted
How can I set this up so:
1) it runs when table changes size (can be by several ways
usually insert text copy, row insert, delete row)
2) Get correct line number (where function is placed at
end of col A)