VB Command Button

  • Thread starter Thread starter WitKnee
  • Start date Start date
W

WitKnee

I have a table in one worksheet that requires user input. To guard against
user error, I put the table that will be doing the calculations in a separate
tab. I want to put a button in that once the table has been completed the
user can click the button and copy their input to the calculating table.
What kind of a code do I need in VB to do this?
 
Say we have two tabs:
input
calc
and the area in input is A1 thru C3
and the area in calc is D2 thru F4:

Sub copy_it()
Set r1 = Sheets("input").Range("A1:D3")
Set r2 = Sheets("calc").Range("D2")
r1.Copy r2
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top