ARHHHRHR
WHat dit i Wrong in this Macro
on a userform i have 3 button
Button 1 Put "1" into cell C1
Button 2 Put "2" into Cell C1
when i Press On Button 1 or Button 2 The cell was Empty
Button 3 Close Userform
Button 3 works fine but not button 1 and 2
Her is my code
Private Sub CommandButton2_Click()
Dim cl As Range
For Each cl In Range("C1")
cl = ""
Next cl
Range("C1").Select
Range("C1").Value = 2
End Sub
Private Sub CommandButton3_Click()
Unload UserForm1
End
End Sub
Private Sub UserForm_Initialize()
'Modified 10/2/2018 9:31:19 PM EDT
Label1.Caption = Worksheets("Ark1").Range("B1").Value
Label2.Caption = Worksheets("Ark1").Range("B1").Value
End Sub
Private Sub CommandButton1_Click()
Dim cl As Range
For Each cl In Range("C1")
cl = ""
Next cl
Range("C1").Select
Range("C1").Value = 1
End Sub
WHat dit i Wrong in this Macro
on a userform i have 3 button
Button 1 Put "1" into cell C1
Button 2 Put "2" into Cell C1
when i Press On Button 1 or Button 2 The cell was Empty
Button 3 Close Userform
Button 3 works fine but not button 1 and 2
Her is my code
Private Sub CommandButton2_Click()
Dim cl As Range
For Each cl In Range("C1")
cl = ""
Next cl
Range("C1").Select
Range("C1").Value = 2
End Sub
Private Sub CommandButton3_Click()
Unload UserForm1
End
End Sub
Private Sub UserForm_Initialize()
'Modified 10/2/2018 9:31:19 PM EDT
Label1.Caption = Worksheets("Ark1").Range("B1").Value
Label2.Caption = Worksheets("Ark1").Range("B1").Value
End Sub
Private Sub CommandButton1_Click()
Dim cl As Range
For Each cl In Range("C1")
cl = ""
Next cl
Range("C1").Select
Range("C1").Value = 1
End Sub
Last edited: