I'm trying to use VBA script to trigger when checkbox is checked that copies data from one particular cell and pastes in the last empty cell of Month column using Today's date. Here is my code thus far, and I've tested the check box triggering the copy and paste function. What I can't figure out is finding the correct column using today's date and selecting the next empty cell in that column. My columns are labeled on a second sheet using long month names (text data).
Sub CheckBoxUpdated()
Dim Mnth As String
Dim fndrng
Dim cb As CheckBox
Mnth = MonthName(Month(Date))
With Sheet2 'has to be 'with' something to work correctly
Set fndrng = Cells.Find(What:=Mnth, After:=A1, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=True)
End With
On Error Resume Next
Set cb = ActiveSheet.DrawingObjects(Application.Caller)
On Error GoTo 0
If Not cb Is Nothing Then
If cb.Value = 1 Then
Sheets("Sheet1").Range(cb.LinkedCell).Offset(0, -4).Copy
Sheets("Sheet2").Activate
fndrng.Offset(4, 0).Select
ActiveSheet.Paste
End If
End If
End Sub
Any help is much appreciated, thanks!!!!