Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50103

Create button and actions to add a "journal entry" based on other fields

$
0
0
I've created a spreadsheet in Excel 2013 that has a bunch of fields that are either calculated or the user enters data into it. Once the user has finished, I'd like to record some of that information in a table. The table can be on a separate tab and effectively becomes a log of all the activity being done.

The table would have 10 or so columns, and each column's value can be grabbed from the fields that the user worked on. I'd like to have a button set up on the main spreadsheet tab that adds a line to the table, using values from other parts of the spreadsheet.

So for example, if the user enters stuff in the main spreadsheet:

A3 = "Ruby"
A4 = "10"
B16 = "125234"
etc.

then when the user has finished and clicks the button, the macro would add a line to the table, either using values from the main sheet or calculating some of them:

Ruby 10 125234 <currentdate/time> <B16*A4>

And then when the user goes back and does more stuff on the main sheet and clicks the button again, it adds another row to the table

Diamond 200 554212 <currentdate/time> <B16*A4>

etc.

I'm not familiar with VisualBasic and scouring forums hasn't uncovered something simple I can try (and led me down an awful lot of wrong rabbitholes!). Any example code would help get me started and I'm sure I could go from there, and I'd be very appreciative!

Viewing all articles
Browse latest Browse all 50103

Trending Articles