C
Corey
The below is the code that i am using to display and update values in cells:
X3 & X6 on a sheet.
I have the rows and columns hiden from view, but the user can see the
current and modify if need by by using the userform.
However rather than creating a userform for each person, how can i use the 1
userform to look at the SAME cells (X3 & X6) DEPENDING on what sheet the
userform was run from????
I though the simple:
ACTIVESHEET.SELECT would do it but it seems to only look to the same sheet.
Private Sub CommandButton1_Click()
activessheet.select
If Me.TextBox2.Value <> "" Then
Range("X3").Value = Me.TextBox2.Value
End If
If Me.TextBox4.Value <> "" Then
Range("X6").Value = Me.TextBox4.Value
End If
UserForm2.Hide
MsgBox "The amounts have been Renewed.", , "title...."
End Sub
Private Sub CommandButton2_Click()
UserForm2.Hide
End Sub
Private Sub Frame1_Click()
End Sub
Private Sub TextBox1_Change()
With Me.TextBox1
End With
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub UserForm_Initialize()
ActiveSheet.Select
With Me.TextBox1
.ControlSource = "X3"
End With
With Me.TextBox3
.ControlSource = "X6"
End With
End Sub
Regards
Corey....
X3 & X6 on a sheet.
I have the rows and columns hiden from view, but the user can see the
current and modify if need by by using the userform.
However rather than creating a userform for each person, how can i use the 1
userform to look at the SAME cells (X3 & X6) DEPENDING on what sheet the
userform was run from????
I though the simple:
ACTIVESHEET.SELECT would do it but it seems to only look to the same sheet.
Private Sub CommandButton1_Click()
activessheet.select
If Me.TextBox2.Value <> "" Then
Range("X3").Value = Me.TextBox2.Value
End If
If Me.TextBox4.Value <> "" Then
Range("X6").Value = Me.TextBox4.Value
End If
UserForm2.Hide
MsgBox "The amounts have been Renewed.", , "title...."
End Sub
Private Sub CommandButton2_Click()
UserForm2.Hide
End Sub
Private Sub Frame1_Click()
End Sub
Private Sub TextBox1_Change()
With Me.TextBox1
End With
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub UserForm_Initialize()
ActiveSheet.Select
With Me.TextBox1
.ControlSource = "X3"
End With
With Me.TextBox3
.ControlSource = "X6"
End With
End Sub
Regards
Corey....