I have an ActiveForm with Employees on Rows, the refresh pastes values over formulae as users sort etc. When the user clicks the Action Button, I need to transfer them to a template within Applications but pass the value of the current employee i.e. the value in column B based on the row related to my selection (the id/name I have selected generally)
Under Advanced Options for the Action Button I have selected Source Type as Value and Source Object then becomes the issue as this is based on the selected Cell or column B for the row I am currently busy with.
What I did find is that the code behind the Action Button does various evaluations so you can actually insert VBA references.
To this end I did the following:
Created a function in a module per:
Code: Select all
Function SelectedEmployee()
SelectedEmployee = Cells(Selection.Row, 2).Text
End Function
Code: Select all
=SelectedEmployee()
p.s. Setting the Source Object to the obvious like
Code: Select all
=Selection
=ActiveCell
=ActiveCell.Value
...
If there is a smarter or simpler way to do this, I would love to know - remember, I am using an Active Form where rows contain the driver and all values in the TM1RPTDATARNG are pasted as values.