Having trouble wrapping my head around condensing this. The blue version is working, the black version is working, but the green is what I'm trying to make happen but not sure how to go about it. It's making "test" a value of zero rather than copying q to test. I get why just not the how to.
Code:
Private Sub TabStrip1_Change()
Dim q As Integer
Dim varTab As Variant
Dim test As Variant
Me.TextBox5.SetFocus
[COLOR=#0000ff]' varTab = Me.TabStrip1.SelectedItem.Caption
' q = Me.TextBox5.Value
' Select Case varTab
' Case Is = "Base"
' Me.TextBox0.Value = q
' Case Is = "Crown"
' Me.TextBox1.Value = q
' Case Is = "Chairrail"
' Me.TextBox2.Value = q
' Case Is = "Jambs"
' Me.TextBox3.Value = q
' End Select
[/COLOR][COLOR=#000000] varTab = Me.TabStrip1.Value
q = Me.TextBox5.Value
[/COLOR][COLOR=#b22222] [/COLOR][COLOR=#008000] test = Me("Textbox" & varTab).Value[/COLOR][COLOR=#000000]
[/COLOR]
Select Case varTab
Case Is = 0, Is = 1, Is = 2, Is = 3
Me("Textbox" & varTab).Value = q
[COLOR=#008000] 'test = q[/COLOR]
End Select
End Sub