Macro to Copy & highlight every so many 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. I also would like to copy whatever is in column B to a new worksheet. So I'm trying to highlight rows 11,21,31 and then copy cell b11,b21,b31, etc into a new worksheet.

Thanks.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

agihcam

Well-known Member
Joined
Jan 16, 2006
Messages
1,624
try;
Code:
Sub testit()
Dim i As Long
For i = 11 To Range("A" & Rows.Count).End(xlUp).Row Step 10
    Cells(i, "a").Interior.Color = vbYellow
    Sheets("Sheet2").Range("a" & Rows.Count).End(xlUp).Offset(1) = Cells(i, "b").Value
Next
End Sub
 

Forum statistics

Threads
1,140,938
Messages
5,703,278
Members
421,289
Latest member
fbohlandt

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
Top