Friday 23 November 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...