blackie42
01-15-2009, 05:31 AM
Hi,
I posted yesterday regarding using a userform to update a sheet then after the sheet updates (with commandbutton) opening another userform and checking which sheet is active - and dependent on that updating its paired sheet. There are the steps (but the paired sheet won't activate)
Open form1 from activesheet
input textbox details and hit cmd button to send to appropriate cells
close form 1 and open form 2
input textbox details and hit cmd button. first code in cmd button is
to check the name of active cell and dependent on result activate the
paired sheet (and then send the textbox details to the appropriate cells)
- Only it will not activate or select (or using with worksheet method as per Lucas last reply) the paired sheet. Details from userform 2 are entered in original activesheet.
Private Sub CommandButton1_Click()
If ActiveSheet.Name = "CMFSPLIT" Then
Worksheets("CMFRUN").Activate
End If
If ActiveSheet.Name = "EUFSPLIT" Then
Worksheets("EUFRUN").Activate
End If
Range("C16").Value = TextBox1.Value
Range("E16").Value = TextBox4.Value
Range("C45").Value = TextBox2.Value
Range("E45").Value = TextBox5.Value
Range("C75").Value = TextBox3.Value
Range("E75").Value = TextBox6.Value
End Sub
Any ideas what I'm doing wrong
thanks
Jon
I posted yesterday regarding using a userform to update a sheet then after the sheet updates (with commandbutton) opening another userform and checking which sheet is active - and dependent on that updating its paired sheet. There are the steps (but the paired sheet won't activate)
Open form1 from activesheet
input textbox details and hit cmd button to send to appropriate cells
close form 1 and open form 2
input textbox details and hit cmd button. first code in cmd button is
to check the name of active cell and dependent on result activate the
paired sheet (and then send the textbox details to the appropriate cells)
- Only it will not activate or select (or using with worksheet method as per Lucas last reply) the paired sheet. Details from userform 2 are entered in original activesheet.
Private Sub CommandButton1_Click()
If ActiveSheet.Name = "CMFSPLIT" Then
Worksheets("CMFRUN").Activate
End If
If ActiveSheet.Name = "EUFSPLIT" Then
Worksheets("EUFRUN").Activate
End If
Range("C16").Value = TextBox1.Value
Range("E16").Value = TextBox4.Value
Range("C45").Value = TextBox2.Value
Range("E45").Value = TextBox5.Value
Range("C75").Value = TextBox3.Value
Range("E75").Value = TextBox6.Value
End Sub
Any ideas what I'm doing wrong
thanks
Jon