Merhaba;
J3'ten J10'a kadar hücreler mevcut.Bu hücrelerde checkboxlarım var.tıkladığım her satırındaki checkbox
,aynı satırdaki j hücresine günün tarihini koymaktadır.Yani j3'e tıkladığımda j3 hücresinde tanımladığım tarihi yazıyor.
bu formülü "j3'ten j10'a checkbox 1'den Checkbox 10'a kadar tek macro ile nasıl yazabilirim.Aksi takdirde aşağıdaki gibi ayrı ayrı yazmam gerekiyor.Yardımcı olabilir misiniz?
J3'ten J10'a kadar hücreler mevcut.Bu hücrelerde checkboxlarım var.tıkladığım her satırındaki checkbox
,aynı satırdaki j hücresine günün tarihini koymaktadır.Yani j3'e tıkladığımda j3 hücresinde tanımladığım tarihi yazıyor.
bu formülü "j3'ten j10'a checkbox 1'den Checkbox 10'a kadar tek macro ile nasıl yazabilirim.Aksi takdirde aşağıdaki gibi ayrı ayrı yazmam gerekiyor.Yardımcı olabilir misiniz?
Kod:
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
Range("A1").Select
Selection.Copy
Range("J3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Else
[J3].Value = ""
End If
End Sub
Private Sub CheckBox2_Click()
If CheckBox2 = True Then
Range("A1").Select
Selection.Copy
Range("J4").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Else
[J4].Value = ""
End If
End Sub
Private Sub CheckBox3_Click()
If CheckBox3 = True Then
Range("A1").Select
Selection.Copy
Range("J5").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Else
[J5].Value = ""
End If
End Sub
Private Sub CheckBox4_Click()
If CheckBox4 = True Then
Range("A1").Select
Selection.Copy
Range("J6").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Else
[J6].Value = ""
End If
End Sub
