entering data on another sheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have the below code which i was hoping would work.
It's supposed to enter the varable defined from the userform1 onto another
sheet which doesn't have focus. However, it enters it onto current sheet, not
onto the RecsC sheet.
Can anyone please help? I've tried different combinations, but cant get it
to work.

Cheers.
Tony.
 
Hi Tony,

Try:

With Worksheets("Sheet3")
Set g = .Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End With
g.Value = UserForm1.strSuppNam

Note the dot before range and the use of the value property of g.
 
Or, disregard the 'with' and try
Set g = Range("'RecsC'!A" & Rows.Count).End(xlUp).Offset(1, 0)
instead of
Set g = Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
 
Hi Norman, Don, Tim.

Thank you all for replying. The "dot" in front of range did the trick.
Thanks again.

Cheers.
Tony.
 

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