Have searched the forum, online etc but cannot work out why I am getting "Subscript out of Range" error in the below code.
The error is in this line
The rest of the with (which forms part of the rest of the code, but this is where the debugger shows the error)
Worksheet("Journal") exists in the workbook.
Any advise would be appreciated.
The error is in this line
Code:
With Worksheets("Journal")
Code:
Sub FuncAllocJnl()
Dim LastCol As Long, x As Long, i As Long
Dim LastRow As Long
Dim rng As Range, c As Range
Dim z As Variant
Application.ScreenUpdating = False
With Worksheets("Journal")
.Rows("7:" & Rows.Count).ClearContents
.Cells(4, 3).Value = Date
.Cells(4, 5) = Format(Date, "yyyy")
.Cells(4, 6) = Format(Date, "mm")
.Cells(4, 6).NumberFormat = "mm"
.Cells(4, 8).Value = "Functional Allocations" & " " & MonthName(Month(Date)) & " " & Year(Date)
End With
Any advise would be appreciated.