Forum

Notifications
Clear all

Macro ResetAll

2 Posts
2 Users
0 Reactions
108 Views
(@mymalone)
Posts: 103
Estimable Member
Topic starter
 

I have the following macro.  I would like to add to the start row and end row.  Start row 49, end row 62.  Start row 81, end row 94.  Keep start 15 row and end row 26

How do I go about adding it to the following so that I have only one macro?  Thanks

Sub resetAll ()

  strtRow =15

 endRow = 26

Call DeleteAllShapes

For r= strtRow To endRow

If Le (Cells(r, 32).Value) = 0 Then

     Range ("AO" & r & ":AT" & endRow) .Interior.Color = 0

     Range ("AO" & r & ":AT" & endRow) .Font.ColorIndex =0

     endRow = r - 1

     Exit For

 End If

 

Next

Range ("AF" & strtRow & ":AT" & endRow) .Interior.Color = x1None

Range ("AF" & strtRow & ":AT" & endRow) .Font.ColorIndex = 1

End Sub

 
Posted : 25/05/2019 4:07 pm
Philip Treacy
(@philipt)
Posts: 1631
Member Admin
 

Hi,

I'm not really clear on what you want to do.

Is it that you want to run the macro on the sets of rows as described i.e.:

15->26

49->62

81->94

Can you please supply your workbook with data and all the code.  Giving you an answer without seeing these might mean not giving you an optimal solution.  If we can see the data and understand what you are trying to do, we might be able to figure out a better solution.

Regards

Phil

 
Posted : 26/05/2019 10:29 pm
Share: