1

Brand new to VBA in Excel coming from HTML forms world and trying to understand how excel expects me to approach a task that, if i work working with an HTML table I'd say:

Each row in my table has a submit button that sends row data to my server.

The first few pages I've stepped into via Google's reply to various forms of 'trigger macro from button in cell' assume that my macro is acting on the whole sheet, not scoping the action to the given cell.

So I want some sort of mechanism (could be just a text-based link, ideally is a button with label 'Update') sitting in column A of each row that, when clicked, triggers a macro that assigns the values of Columns B, C, and D to variable name VarB, VarC, and VarD respectively.

thnkx

1 Answer 1

0

Worksheets and html forms are quite different and instead of using buttons on each row that are not very efficient (and rather hard to control on new line for example), you can use the macro to read the curent selected cell or row to act on the cells you want only. You can use ActiveCell object to retrieve it.

For example ActiveCell.Row will return the row of the selected cell and you use it as the scope for your macro so you can read the values in the desired columns of this row.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .