Macro to Count Every X amount of Rows

rjacmuto32

Board Regular
Joined
Jul 14, 2004
Messages
98
I have 101 rows of data with row 1 being my header row. I want to do a macro to highlight every 10 rows all the way to the end. So I want rows 11,21,31,etc to be highlighted. How do I do that?

Thanks.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Why do you need a macro? Why not use Conditional Formatting?

With Conditional Formatting:

Select your entire range, i.e. A1:IV101

Click on Format, then Conditional Formatting
Under Condition 1, change Cell Value Is to Formula Is and put in the following formula:
=MOD(ROW(),11)=0
Click on Format
Click on Patterns
Select a color
Click OK
Click OK
 
Upvote 0
Forgot to add this

Besides highlighting I would also like to copy column B of every 10th row into a new worksheet. If i conditional format the cells for that, how do i use a macro to copy cell B11,B21,B31 etc.
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,423
Members
448,961
Latest member
nzskater

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