Hi
Below is a piece of code which is giving me error "Compile error Wrong number of arguments or invalid property assignment"
This is not the complete code, however at every month function I am getting this error.
Need help on this !!!
count = Range("A1", Range("A1").End(xlDown)).count
Range("A1").End(xlToRight).Offset(0, 1).Select
ActiveCell.Value = "Month-Year"
ActiveCell.Offset(1, 0).Select
i = 2
While i <= count
Dim res2 As Variant
On Error Resume Next
res2 = Month(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0))) & "-" & Year(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0)))
If res2 = "" Then
ActiveCell.Value = ""
Else: ActiveCell.Value = Month(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0))) & "-" & Year(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0)))
End If
Below is a piece of code which is giving me error "Compile error Wrong number of arguments or invalid property assignment"
This is not the complete code, however at every month function I am getting this error.
Need help on this !!!
count = Range("A1", Range("A1").End(xlDown)).count
Range("A1").End(xlToRight).Offset(0, 1).Select
ActiveCell.Value = "Month-Year"
ActiveCell.Offset(1, 0).Select
i = 2
While i <= count
Dim res2 As Variant
On Error Resume Next
res2 = Month(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0))) & "-" & Year(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0)))
If res2 = "" Then
ActiveCell.Value = ""
Else: ActiveCell.Value = Month(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0))) & "-" & Year(Cells(i, Application.WorksheetFunction.Match("Completed On", Rows(1), 0)))
End If