Hi,
I have a template I am trying to create but not particularly efficient in the coding. So I have a sheet that has three main columns (1,2 and 3) and breaks down into another 3 columns within (a, b, and c). In my userform I have a date entry where I would like to enter the date and then use the offset dependent on the column I specify using the option buttons. I also have my Command button 2 where I am trying to set the range and reset to 0 but it only resets the first cell in the range?
Any help would be appreciated, I have attached the code and image of the workbook, I can't seem to be able to upload the work book?
Cheers,
Private Sub CommandButton1_Click()
If OptionButton1.Value = True Then
ActiveSheet.Range("F10").Select
ActiveCell = TextBox1.Value
End If
If OptionButton2.Value = True Then
ActiveSheet.Range("I10").Select
ActiveCell = TextBox1.Value
End If
If OptionButton3.Value = True Then
ActiveSheet.Range("L10").Select
ActiveCell = TextBox1.Value
End If
If OptionButton1.Value = True Then
ActiveSheet.Range("G10").Select
ActiveCell = TextBox2.Value
End If
If OptionButton2.Value = True Then
ActiveSheet.Range("J10").Select
ActiveCell = TextBox2.Value
End If
If OptionButton3.Value = True Then
ActiveSheet.Range("M10").Select
ActiveCell = TextBox2.Value
End If
If OptionButton1.Value = True Then
ActiveSheet.Range("H10").Select
ActiveCell = TextBox3.Value
End If
If OptionButton2.Value = True Then
ActiveSheet.Range("K10").Select
ActiveCell = TextBox3.Value
End If
If OptionButton3.Value = True Then
ActiveSheet.Range("N10").Select
ActiveCell = TextBox3.Value
End If
End Sub
Private Sub CommandButton2_Click()
If OptionButton1.Value = True Then
ActiveSheet.Range("F10:H10").Select
ActiveCell = "0"
End If
If OptionButton2.Value = True Then
ActiveSheet.Range("I10:K10").Select
ActiveCell = "0"
End If
If OptionButton3.Value = True Then
ActiveSheet.Range("L10:N10").Select
ActiveCell = "0"
End If
End Sub
Private Sub CommandButton3_Click()
Unload Me
End Sub
Capture.JPG
Bookmarks