I am currently using a check box to place the current date in column 8 for a given row. I would like to modify the code shown below to also change the value in column 7 to a range called "NAME".
Can anyone help?
Can anyone help?
Code:
Sub CheckBoxDate()
Dim ws As Worksheet
Dim chk As CheckBox
Dim lColD As Long
Dim lColChk As Long
Dim lRow As Long
Dim rngD As Range
lColD = 8 'number of columns to the right for date
Set ws = ActiveSheet
Set chk = ws.CheckBoxes(Application.Caller)
lRow = chk.TopLeftCell.Row
lColChk = chk.TopLeftCell.Column
Set rngD = ws.Cells(lRow, lColChk + lColD)
Select Case chk.Value
Case 1 'box is checked
rngD.Value = Date
Case Else 'box is not checked
rngD.ClearContents
End Select
End Sub