Perform Macro Based on Border Color

Kinchen

New Member
Joined
Aug 22, 2011
Messages
14
Hi all,

I'm looking to create a Macro that searches the defined ranges (Range1 to 75) in a sheet called "Layout" and if it has a red border then I want it to perform a Macro after users double click on the Range. The Macro will be to unhide rows on a second sheet called "Reports". I have a similar thread using checkboxes and a command button, but based on feedback from users; they'd prefer something different.

What I have so far is:
Code:
Sub CreateReport()
Dim x As Integer
Dim rng As Range
For x = 1 To 75

If rng(x) = bordershade: red Then
Sheets("Reports").Select
[(x-1)*35 +1:x*35].EntireRow.Hidden = False
Else
Sheets("Reports").Select
[(x-1)*35 +1: x*35].EntireRow.Hidden = True
End If
Next x

End Sub
I'm not sure how to incorporate the double click part and i'm still working on the bordershade: red selection property.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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