Link to home
Start Free TrialLog in
Avatar of Kiwi-123
Kiwi-123

asked on

error message when using code in excel 2007 / 2003

The code below works a treat in excel 2010, however when I tried this in excel 2007 or 2003, I get an error message on "  .Resize(, 13).ClearContents"

Please can you help.

Private Sub CommandButton3_Click()
Dim Password

Password = "abc"
If InputBox("Please Enter Password") = Password Then

Application.ScreenUpdating = False

   
    With Sheets("Low Volume").[B8].CurrentRegion
        .AutoFilter
        .AutoFilter Field:=13, Criteria1:="<>"
        With .Resize(.Rows.Count - 1).Offset(1).SpecialCells(xlCellTypeVisible)
            .Copy Sheets("Archive").Cells(Rows.Count, 2).End(xlUp).Offset(1)
            .Resize(, 13).ClearContents
            .Resize(, 1).Offset(, 16).ClearContents
        End With
        .AutoFilter
       
    End With

Application.ScreenUpdating = True

End If
       
End Sub
help234.xls
ASKER CERTIFIED SOLUTION
Avatar of rejoinder
rejoinder
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kiwi-123
Kiwi-123

ASKER

Thanks for your help, I will get a screenshot of the error and re-post.