Hi, I have a formula here which works but is not so handy. I dont want for example create a new userform for every day in Januari as you can se that I have done here. Is there a way to create a code to do the same thing with only one userform and a shorter code?
Code:
If Not Application.Intersect(Target, Range("B5")) Is Nothing And Me.ComboBox1.Value = "Jan" ThenJan1.Show
sh1.Range("A13:A21").Value = sh2.Range("B2:B10").Value
sh1.Range("B13:B21").Value = sh2.Range("C2:C10").Value
sh1.Range("D13:D21").Value = sh2.Range("E2:E10").Value
End If
If Not Application.Intersect(Target, Range("C5")) Is Nothing And Me.ComboBox1.Value = "Jan" Then
Jan2.Show
sh1.Range("A13:A21").Value = sh2.Range("B12:B21").Value
sh1.Range("B13:B21").Value = sh2.Range("C12:C21").Value
sh1.Range("D13:D21").Value = sh2.Range("E12:E21").Value
End If
If Not Application.Intersect(Target, Range("D5")) Is Nothing And Me.ComboBox1.Value = "Jan" Then
Jan3.Show
sh1.Range("A13:A21").Value = sh2.Range("B23:B32").Value
sh1.Range("B13:B21").Value = sh2.Range("C23:C32").Value
sh1.Range("D13:D21").Value = sh2.Range("E23:E32").Value
End If