Right now, I have a working VBA that allows me to input something into my first Text Box TB1 and it will change what is in cell A2 on the current worksheet. Then, based on what is inputted, the rest of my text boxes will then change what is in cells B2-Y2. The other text boxes in my VBA form display what are in the cells B2-Y2 where TB2(text box 2) displays B2, TB3(text box 3) displays C2 etc. Right now, I am having the issue with my code where if the Excel workbook is not in the correct worksheet that I want it in, the VBA will change what is in cell A2 of whichever worksheet I'm in rather than changing whats in cell A2 of Sheet2 like I want it. I would love help with the syntax of how I get that done.
Thanks,
Here is the code in my VBA Userform
Thanks,
Here is the code in my VBA Userform
Code:
Private Sub Image1_Click()
End Sub
Private Sub Label11_Click()
End Sub
Private Sub Label53_Click()
Link = TB24.Text
On Error GoTo NoCanDo
ActiveWorkbook.FollowHyperlink Address:=Link, NewWindow:=True
Exit Sub
NoCanDo:
MsgBox "Cannot open" & Link
End Sub
Private Sub TB1_AfterUpdate()
Dim I As Integer
For I = 2 To 17
Me.Controls("TB" & I).Text = Cells(2, I).Text
Next I
For k = 22 To 25
Me.Controls("TB" & k).Text = Cells(2, k).Text
Next k
End Sub
Private Sub TB2_Change()
End Sub
Private Sub TB22_Change()
End Sub
Private Sub TB23_Change()
End Sub
Private Sub TB24_Change()
End Sub
Private Sub TB3_Change()
End Sub
Private Sub TB4_Change()
End Sub
Private Sub UserForm_Initialize()
Me.TB1.ControlSource = Cells(2, 1).Address
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub UserForm_Activate()
With Application
Me.Top = .Top
Me.Left = .Left
Me.Height = .Height
Me.Width = .Width
End With
End Sub
Last edited by a moderator: