ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA syntax for Font & Interior ColorIndex (https://www.excelbanter.com/excel-discussion-misc-queries/564-re-vba-syntax-font-interior-colorindex.html)

Dennis

VBA syntax for Font & Interior ColorIndex
 
Thanks for your time and knowledge, happy holidays

Dennis

"Don Guillett" wrote:

Range("d15") = Range("c15").Font.ColorIndex

--
Don Guillett
SalesAid Software

"Dennis" wrote in message
...
Using XL 2003 & 97


Would like to place the "value or name" of a cell A1's current
Font.ColorIndex in B1 and A1's current Interior.ColorIndex into C1

By "value", I mean either the Font.ColorIndex (number) or (xlNone), or
better, "Yellow" for 6 or "Red" for 3 or "xlNone".

Similarly, Interior.ColorIndex (number) or (xlNone) or better "Yellow" for

6
or "Red" for 3 or "xlNone".

Therefore,

A B C
[Font.ColorIndex] [Interior.ColorIndex]
1 (Contents "Yellow" (or "6") "Red" (or "3")
whatever)

2 (Contents "xlNone" "xlNone"
whatever)


I am not sure how to code Range.("A1").Font.ColorIndex.name
or Range.("A1").Interior.ColorIndex.name ?

So that I could code something like:

Range.("B1").value = Range.("A1").Font.ColorIndex.name
Range.("C1").value = Range.("A1").Interior.ColorIndex.name
Range.("B2").value = Range.("A2").Font.ColorIndex.name
Range.("C2").value = Range.("A2").Interior.ColorIndex.name

Hopefully I have been clear?

TIA Dennis





Don Guillett

glad to help. Eat a turkey or drink a wild turkey

--
Don Guillett
SalesAid Software

"Dennis" wrote in message
...
Thanks for your time and knowledge, happy holidays

Dennis

"Don Guillett" wrote:

Range("d15") = Range("c15").Font.ColorIndex

--
Don Guillett
SalesAid Software

"Dennis" wrote in message
...
Using XL 2003 & 97


Would like to place the "value or name" of a cell A1's current
Font.ColorIndex in B1 and A1's current Interior.ColorIndex into C1

By "value", I mean either the Font.ColorIndex (number) or (xlNone), or
better, "Yellow" for 6 or "Red" for 3 or "xlNone".

Similarly, Interior.ColorIndex (number) or (xlNone) or better "Yellow"

for
6
or "Red" for 3 or "xlNone".

Therefore,

A B C
[Font.ColorIndex] [Interior.ColorIndex]
1 (Contents "Yellow" (or "6") "Red" (or "3")
whatever)

2 (Contents "xlNone" "xlNone"
whatever)


I am not sure how to code Range.("A1").Font.ColorIndex.name
or Range.("A1").Interior.ColorIndex.name ?

So that I could code something like:

Range.("B1").value = Range.("A1").Font.ColorIndex.name
Range.("C1").value = Range.("A1").Interior.ColorIndex.name
Range.("B2").value = Range.("A2").Font.ColorIndex.name
Range.("C2").value = Range.("A2").Interior.ColorIndex.name

Hopefully I have been clear?

TIA Dennis








All times are GMT +1. The time now is 02:48 AM.

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