troubleshooting Question

Do Until Loop within a table

Avatar of William C Johnson
William C JohnsonFlag for United States of America asked on
Microsoft OfficeMicrosoft ExcelVBA
11 Comments1 Solution53 ViewsLast Modified:
I want to run this macro on every row in the Product table.  What is the best way to loop this macro from top to bottom of the Product table?  The number of lines will always vary.

Sub Reset_Part2()
' Reset_Part2 Macro
' Test for ORDER NOW and reset values for each row in the Product table.Craft-Paint-Inventory.xlsmCraft-Paint-Inventory.xlsm
    If ActiveCell.Value = "ORDER NOW" Then
        ActiveCell.Offset(0, -3).Range("Products[[#Headers],[Code]]").Select
        ActiveCell.FormulaR1C1 = "0"
        ActiveCell.Offset(0, 1).Range("Products[[#Headers],[Code]]").Select
        ActiveCell.FormulaR1C1 = "0"
        ActiveCell.Offset(0, 2).Range("Products[[#Headers],[Code]]").Select
    End If
    ActiveCell.Offset(1, 0).Range("Products[[#Headers],[Code]]").Select
End Sub
Saqib Husain

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
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 1 Answer and 11 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