Macro to highlight columns with unknow rows

Apple08

Active Member
Joined
Nov 1, 2014
Messages
450
Hi All

I like to create a macro to highlight the columns in the sheet "Data" starting from row 2 to the last row which is unknow. The last row could be based on the value in column A.

I would like to highlight colour RGB as below:

D and E - 155, 194, 230
J and K - 255, 242, 204
L and M - 221, 235, 247

Thanks for any help.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How about
VBA Code:
Sub Apple()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Offset(, 3).Resize(, 2).Interior.Color = RGB(155, 194, 230)
      .Offset(, 9).Resize(, 2).Interior.Color = RGB(255, 242, 204)
      .Offset(, 11).Resize(, 2).Interior.Color = RGB(221, 235, 247)
   End With
End Sub
 
Upvote 0
Solution
How about
VBA Code:
Sub Apple()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Offset(, 3).Resize(, 2).Interior.Color = RGB(155, 194, 230)
      .Offset(, 9).Resize(, 2).Interior.Color = RGB(255, 242, 204)
      .Offset(, 11).Resize(, 2).Interior.Color = RGB(221, 235, 247)
   End With
End Sub
Brilliant! It works perfectly! Thanks Fluff :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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