ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing a cell color in different workbook (https://www.excelbanter.com/excel-programming/343906-referencing-cell-color-different-workbook.html)

FireGeek822

Referencing a cell color in different workbook
 
I need to programmatically reference a cell in a different workbook
(Excel file). Once I reference that cell, I need to determine the
color and then change a cell in my current workbook to that exact
color. Example:

C:\ExcelFile1.xls
Column C
Row 33
Color is Blue

H:\Project\MasterPlan.xls
Column H
Row 40
Color needs to be Blue as it is in above workbook\cell.

Any thoughts? THANKS

Tammy



Bob Phillips[_6_]

Referencing a cell color in different workbook
 
Will the workbooks be open? Assuming so


Workbooks("MasterPlan.xls").Worksheets("Sheet1").R ange("H40").Interior.Color
index = _

Workbooks("ExcelFile.xls").Worksheets("Sheet1").Ra nge("C33").Interior.Colori
ndex


--

HTH

RP
(remove nothere from the email address if mailing direct)


"FireGeek822" wrote in message
oups.com...
I need to programmatically reference a cell in a different workbook
(Excel file). Once I reference that cell, I need to determine the
color and then change a cell in my current workbook to that exact
color. Example:

C:\ExcelFile1.xls
Column C
Row 33
Color is Blue

H:\Project\MasterPlan.xls
Column H
Row 40
Color needs to be Blue as it is in above workbook\cell.

Any thoughts? THANKS

Tammy





FireGeek822

Referencing a cell color in different workbook
 
Thanks Bob. My first try with this I used RGB( ) and didn't realize
the color index is a long number and doesn't use the traditional RGB
numbers.

Now I need to try to restrict all users of both workbooks to use only 6
specific colors.

I appreciate the help Bob, Thanks Again!!!

Tammy



All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com