Hello,
what is the way to shorten this formula:
what is the way to shorten this formula:
Code:
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = Worksheets("Settings")
Unload Menu
With Menu_Names
.TextBox1.Value = ws.Range("V2").Value
.TextBox5.Value = ws.Range("V3").Value
.TextBox9.Value = ws.Range("V4").Value
.TextBox13.Value = ws.Range("V5").Value
.TextBox17.Value = ws.Range("V6").Value
.TextBox21.Value = ws.Range("V7").Value
.TextBox25.Value = ws.Range("V8").Value
.TextBox29.Value = ws.Range("V9").Value
.TextBox33.Value = ws.Range("V10").Value
.TextBox2.Value = ws.Range("W2").Value
.TextBox6.Value = ws.Range("W3").Value
.TextBox10.Value = ws.Range("W4").Value
.TextBox14.Value = ws.Range("W5").Value
.TextBox18.Value = ws.Range("W6").Value
.TextBox22.Value = ws.Range("W7").Value
.TextBox26.Value = ws.Range("W8").Value
.TextBox30.Value = ws.Range("W9").Value
.TextBox34.Value = ws.Range("W10").Value
.TextBox3.Value = ws.Range("X2").Value
.TextBox7.Value = ws.Range("X3").Value
.TextBox11.Value = ws.Range("X4").Value
.TextBox15.Value = ws.Range("X5").Value
.TextBox19.Value = ws.Range("X6").Value
.TextBox23.Value = ws.Range("X7").Value
.TextBox27.Value = ws.Range("X8").Value
.TextBox31.Value = ws.Range("X9").Value
.TextBox35.Value = ws.Range("X10").Value
.TextBox4.Value = ws.Range("Y2").Value
.TextBox8.Value = ws.Range("Y3").Value
.TextBox12.Value = ws.Range("Y4").Value
.TextBox16.Value = ws.Range("Y5").Value
.TextBox20.Value = ws.Range("Y6").Value
.TextBox24.Value = ws.Range("Y7").Value
.TextBox28.Value = ws.Range("Y8").Value
.TextBox32.Value = ws.Range("Y9").Value
.TextBox36.Value = ws.Range("Y10").Value
End With
Menu_Names.Show
Set ws = Nothing
Unload Me
End Sub