Inserting data into a different worksheet

  • Thread starter Thread starter rickalty
  • Start date Start date
R

rickalty

Hello, I have a VBA form that a user completes to add data. When the
form is closed, I can transfer the data into the current worksheet by
this....


Code:
--------------------

Range("h" & TankLine).Value = txtDate.Text
Range("i" & TankLine).Value = txtTime.Text
Range("g" & TankLine).Value = txtInits.Text

--------------------


but I can't get it to put data into a different worksheet in the same
workbook. I have tried


Code:
--------------------

Sheet1.Range("h" & TankLine).Value = txtDate.Text

--------------------


and


Code:
--------------------

Sheet1!Range("h" & TankLine).Value = txtDate.Text

--------------------


but neither works.

How do I do this, please?

Thanks,
Richard
 

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