Friday, November 23, 2018

Excel VBA row calling cell on multi cell paste (Not ActiveCell.Row)

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

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...