Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I may write this : Range("A1:A10").Interior.ColorIndex = 0 But i could write this too ... '--------------------- Dim x As Excel.Constants x = xlNone Range("A1:A10").Interior.ColorIndex = x '--------------------- The value of Xlnone = -4142 Any explanations why both methods work ? Thank for your collaboration and help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Because 0 is white. It removes the border though.
-- __________________________________ HTH Bob "MichDenis" wrote in message ... Hi, I may write this : Range("A1:A10").Interior.ColorIndex = 0 But i could write this too ... '--------------------- Dim x As Excel.Constants x = xlNone Range("A1:A10").Interior.ColorIndex = x '--------------------- The value of Xlnone = -4142 Any explanations why both methods work ? Thank for your collaboration and help. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() | Because 0 is white. It removes the border though. Not on my computer... Try this : '----------------------- Sub test() Range("A1:A10").Interior.ColorIndex = 0 MsgBox Range("A1").Interior.ColorIndex End Sub '----------------------- Or this, '----------------------- Sub test1() Range("A1:A10").Interior.ColorIndex = xknone MsgBox Range("A1").Interior.ColorIndex End Sub '----------------------- The message is the same : Message = -4142 Thank for your collaboration. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
0 is none, 2 is white.
Cliff Edwards |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
i think your are a little hung up on thinking that this should be a black and white issue. not. see this site. http://www.mvps.org/dmcritchie/excel/colors.htm there is no color 0(zero) there is no color xlnone. xlnone means(in some cases) revert to defaults. but it is applied to more that color and interiors. Range("A1:A10").Font.ColorIndex = xlnone your msgbox will now say 4. Range("A1:A10").Linestyle = xlnone Range("A1").pastespecial Paste:=xlPasteAll, operation = xlnone and it goes on and on. understand that many things have more than one word or meaning. some people call it a pier. some people call it a warf. why do we have two words for the same thing? it is not much different in programming. why does xlnone have so many meanings? who know? the important thing is to learn how to use it in all of its different meanings. my thoughts regards FSt1 "MichDenis" wrote: | Because 0 is white. It removes the border though. Not on my computer... Try this : '----------------------- Sub test() Range("A1:A10").Interior.ColorIndex = 0 MsgBox Range("A1").Interior.ColorIndex End Sub '----------------------- Or this, '----------------------- Sub test1() Range("A1:A10").Interior.ColorIndex = xknone MsgBox Range("A1").Interior.ColorIndex End Sub '----------------------- The message is the same : Message = -4142 Thank for your collaboration |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range("A1").Interior.ColorIndex=xyz does not work | Excel Programming | |||
"Error 1004 Unable to set the ColorIndex property of the Interior. | Excel Programming | |||
"COUNTIF" using ".ColorIndex" and "AND" | Excel Programming | |||
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" | Excel Programming | |||
colorindex = xlnone on condition of month of year | Excel Programming |