PDA

View Full Version : changing textbox colour?



selraith
11-13-2007, 05:22 AM
hi is it possible changing the textbox colour like a normal textbox because ive tried using a macro and it wont show the colour change of the textbox...

rory
11-13-2007, 05:51 AM
Font colour, background colour, or border colour? Also, are we talking about a textbox on a userform or a worksheet?

selraith
11-13-2007, 05:53 AM
Font colour, background colour, or border colour? Also, are we talking about a textbox on a userform or a worksheet?

WorkSheet and its the textbox font colour

rory
11-13-2007, 06:30 AM
If it's a textbox from the drawing toolbar, you can use:
ActiveSheet.TextBoxes(1).Font.ColorIndex = 12
syntax.

selraith
11-13-2007, 06:41 AM
If it's a textbox from the drawing toolbar, you can use:
ActiveSheet.TextBoxes(1).Font.ColorIndex = 12
syntax.

i dont understand why you've written Font.ColorIndex = 12 ?!?!? and if i wanted it green how would i do that?

rory
11-13-2007, 07:04 AM
Because you didn't say what colour you wanted, so I just picked one. Using a default colour palette, you could use 10 instead of 12 to get green, I think. Or you could use .Color = vbGreen instead of using .Colorindex, and you'll get the closest match to an available colour.

selraith
11-13-2007, 07:39 AM
Because you didn't say what colour you wanted, so I just picked one. Using a default colour palette, you could use 10 instead of 12 to get green, I think. Or you could use .Color = vbGreen instead of using .Colorindex, and you'll get the closest match to an available colour.

Thank you that was the solution thank you very much i got it work as well heheheh code i used was:


ActiveSheet.TextBoxes.Font.ColorIndex = 12


I didnt add the (1) so i could change all the textbox colour ... but thanks alot it helps alot :rotlaugh: .... :clap: