I have a VBA script that I use the calling cell to do some processing. It works great when I only paste it into one cell but if I paste into multiple cells, ActiveCell is always the first selected cell in the range and so all the cells get the same value.
How do I get the row of the cell that the function is being called from?
Example VBA - (in one cell do =TestCallCell() then copy and paste into several cells)
Function TestCallCell() As String
curRow = ActiveCell.Row
TestCallCell = curRow
End Function
No comments:
Post a Comment