Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format from another Workshet
Hello,
I tried to use this code to make it easy. But the macro failed at colorindex. With Range("A:BF") .Formula = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Formula .ColorIndex = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Interior.ColorIndex .Pattern = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Interior.Pattern End With How can I combine all that ? Nde |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format from another Workshet
You're definately on the right track here, the only thing I can see is you
need to reference the ".interior" property before the .colorindex & .pattern ..... as in "interior.colorindex" & "interior.pattern". Likely you will need both spreadsheets open to run the code snippet. Addressing each column as a range may not give you the results you are looking for if each cell in the column has different formatting in which case you may need to address each cell individually (just not sure) Best "Nde" wrote: Hello, I tried to use this code to make it easy. But the macro failed at colorindex. With Range("A:BF") .Formula = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Formula .ColorIndex = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Interior.ColorIndex .Pattern = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Interior.Pattern End With How can I combine all that ? Nde |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy format from another Workshet
The Macro works, but not results ! Youe guess was the good one, cells have
different format ! How can I go through each cell ? Nde "Dave" wrote: You're definately on the right track here, the only thing I can see is you need to reference the ".interior" property before the .colorindex & .pattern .... as in "interior.colorindex" & "interior.pattern". Likely you will need both spreadsheets open to run the code snippet. Addressing each column as a range may not give you the results you are looking for if each cell in the column has different formatting in which case you may need to address each cell individually (just not sure) Best "Nde" wrote: Hello, I tried to use this code to make it easy. But the macro failed at colorindex. With Range("A:BF") .Formula = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Formula .ColorIndex = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Interior.ColorIndex .Pattern = Workbooks(ReforecastWorkbook).Sheets("ReForecast - Detailed").Range("A:BF").Interior.Pattern End With How can I combine all that ? Nde |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel workshet can not open in desktop | Excel Discussion (Misc queries) | |||
Automatic extend row in workshet. | New Users to Excel | |||
Automatic extend row in workshet. | New Users to Excel | |||
Placing Workshet Name in cells | Excel Programming | |||
Workshet onchange | Excel Programming |