PDA

View Full Version : Solved: Form VBA



Scooter172
06-04-2010, 02:23 PM
I have a testworkbook that I am trying to have a form open on to update data in specific cells. I have the form built, and the code to save to a cell but the data in the specified range changes on whatever sheet I have open. How to I adjust to make it save to sheet one if sheet 3 is open

Ctrl+n is shortcut


:bow:

GTO
06-04-2010, 04:27 PM
If you change the attachment to .xls format, you may get quicker/more response(s).

mdmackillop
06-05-2010, 08:35 AM
You just need to qualify the Range references with the Sheet reference

Private Sub cmdSubmit_Click()
With Sheets(1)
.Range("C1").Value = tbxFirstName
tbxFirstName = Empty
frmDataEntry.Hide
.Range("A1").Value = tbxLRV1
tbxLRV1 = Empty
.Range("A2").Value = tbxLRV2
tbxLRV2 = Empty
.Range("A3").Value = tbxLRV3
tbxLRV3 = Empty
frmDataEntry.Hide
End With
End Sub