Color for results from different sheets

Cor02767

New Member
Joined
Jun 17, 2011
Messages
1
HI all,



I am working on a parts list that will have different sheets.
Each sheet will have 100s of parts and youneed to go to each sheet and pick the ones you want. I have a macro where if qty is >1 it will take that row wirth colums a-f to the master parts sheet for the specific job.

So on the master sheet you will only see the parts that have a qty from each sheet. So far so good.


What I would like to do now is to be able to select a specific color that I can pick for each sheet.

So sheet 1 will have 10 parts and those rows will be highlighted in red on the master sheet, then sheet 2 will have 15 parts and those rows will be highlighted in green or what ever color etc.


Can't figure out where or how to select the colors in VBA to make this happen.

Any suggestions?


Thanks
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
To color a cell in VBA

Range("A1").Interior.ColorIndex=3

To get a list of color indexes run this

Code:
Sub Colors()
Dim i As Long
Sheets.Add
For i = 1 To 56
    Range("A" & i).Value = 1
    Range("B" & i).Interior.ColorIndex = i
Next i
End Sub
 
Upvote 0
Use the Interior property to return the Interior object. The following example sets the color for the interior of cell A1 to red.

Code:
Worksheets("Sheet1").Range("A1").Interior.ColorIndex = 3
 
Upvote 0

Forum statistics

Threads
1,224,604
Messages
6,179,857
Members
452,948
Latest member
UsmanAli786

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