troubleshooting Question

compile error variable not defined in macro

Avatar of route217
route217Flag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft Excel
7 Comments3 Solutions505 ViewsLast Modified:
Hi experts

I am trying to run the following macro and I am getting the msg as per subject box

vba code:
Sub Tidyup() Dim ws As Worksheet Dim i As Long For Each ws In Worksheets(Array("Daily Data", "MTD Data", "Weekly Data", "Monthly Data")) For i = ws.Range("B" & Rows.Count).End(xlUp).Row To Step -1 If ws.Range("B" & i) Like "DMX*" Then ws.Range("B" & i).Resize(, 30).Delete xlShiftUp End If Next i Next ws End Sub

on line .row to step -1
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros