Error In VBA Excel

Ashkan Azadikhah 0 Reputation points
It gives an error when executing the following commands except for the last sheet. where is the problem from?

   Dim SheetNum, ProjectNum As Integer
    For SheetNum = Sheets.Count To 1 Step -1
      With Sheets(SheetNum)
        Co = WorksheetFunction.Match(ProjectNum,.Rows(1))
        .Range(Columns(Co - 3), Columns(Co)).Delete
      End With
    Next Sh
Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
2,121 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Olaf Helper 33,836 Reputation points

    where is the problem from?

    The question is more, which detailed error message do you get, in whcih line and what is "WorksheetFunction.Match(ProjectNum,.Rows(1))"

    You have to provide more details.

    0 comments No comments