I have a user form that has many text values associated with it, I've added a spin button on to the form but I am not able to retrieve the value of each row and cell to populate the form.
Here is what I have:
Sub ShowCurrentRecord()
Dim Wks As Worksheet
Set Wks = ThisWorkbook.Worksheets(1)
With UserForms(0)
R = .SpinButton1.Value + 1
.Textbox3 = Wks.Cells(R, "A").Value
.Textbox2 = Wks.Cells(R, "B").Value
.Textbox1 = Wks.Cells(R, "C").Value
.TextBox14 = Wks.Cells(R, "D").Value
.TextBox15 = Wks.Cells(R, "E").Value
.TextBox13 = Wks.Cells(R, "F").Value
.TextBox7.Value = .SpinButton1.Value
End With
End Sub
The problem I have is when I try to run it gives me a variable not defined on this line of code.
R = .SpinButton1.Value + 1
What am I missing? Do I have to define r as Row?
Bookmarks