Macro calculate only a cell or a range of cells on multi sheets

ste33uka

Active Member
Joined
Jan 31, 2020
Messages
471
Office Version
  1. 365
Platform
  1. Windows
Hi my workbook has 55 sheets, the 1st 5 sheets are different names which i dont want macro to run on.
the next 50 sheets are named 1,2,3,4,5,6,7 and so on.
Would anyone have a macro that would calculate cells (iy4:iy75) (c4:c75) and J4,J8,J12 on all 50 sheets named 1,2,3,4,5,6,7.........
Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
1.what is Name of your first 5 sheets. Write here. we need them for macro.
2. what formula you have to calculate for each ranges that you told.
 
Upvote 0
1.what is Name of your first 5 sheets. Write here. we need them for macro.
2. what formula you have to calculate for each ranges that you told.
formulas are all different,
1st name is 1
then 2,3,4,5,6 and so on

1.PNG
 
Upvote 0
Try something like this
VBA Code:
Sub test()
Dim i As Long
    For i = 1 To 50
        With Sheets(CStr(i)).Select
       
'             Do the calculation you need

        End With
    Next

End Sub
 
Upvote 0
Solution
Try something like this
VBA Code:
Sub test()
Dim i As Long
    For i = 1 To 50
        With Sheets(CStr(i)).Select
      
'             Do the calculation you need

        End With
    Next

End Sub
Thanks alot, thats what i was looking for.
 
Upvote 0
You are very welcome
And thank you for the feedback
Be happy
 
Upvote 0

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top