|
-
Apr 30th, 2007, 11:17 AM
#1
Thread Starter
Member
How to fill color in a particular Excel cell ??
Hi!
I just wanted to know how to color a particular cell in an excel worksheet. I guess it wont be that difficult but dun know the command to do this.. Please Help
cheers
Abhilash
PS: I also wanted to know how to use checkboxes in a windows form. I would be thankful if anyone can help me out..
-
Apr 30th, 2007, 11:55 AM
#2
Re: How to fill color in a particular Excel cell ??
Hi Abhi
Lets say you want to color the cell E6 Red then follow the below code 
vb Code:
Range("E6").Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Remember, whenever in doubt, simply record a macro
Also check out the FAQ's on How to record a Macro. I believe Rob has it covered in the FAQ's
Regd Checkboxes, what exactly do you want to do?
ps: You can add checkboxes in the design mode and then double click on the control to get to the code area to type in the code.
Hope this helps...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
May 1st, 2007, 04:32 AM
#3
Thread Starter
Member
Re: How to fill color in a particular Excel cell ??
hi..
thx for the help.. wanted to ask.. can i run a macro through a vb code..
oh.. so the method for checkboxes and buttons are the same is it..??
cheers
Abhilash
-
May 1st, 2007, 05:30 AM
#4
Member
Re: How to fill color in a particular Excel cell ??
Essentially your macro is VB code, so there's no issue there - just call it as a separate function from your VB code.
Did you want to add checkboxes etc in Excel or Access?
~ James
-
May 1st, 2007, 12:34 PM
#5
Thread Starter
Member
Re: How to fill color in a particular Excel cell ??
oh ok.. thx james..
i wan to add checkboxes in a normal windows form.. but i am writing a code which performs functions on excel depending on which checkboxes are checked..
precisely, the only difference will be in the column name which is worked on depending on which box is checked..
cheers
Abhilash
-
May 1st, 2007, 12:39 PM
#6
Re: How to fill color in a particular Excel cell ??
Incidentally, did you know that there is a property called LinkedCell for objects in the main Excel sheet, and ControlSource for those on a UserForm, which link the value of a checkbox (etc) to an Excel cell, so that changes in the box can be referred directly into the sheet and vice versa. You could therefore use conditional formatting - if the value of a particular cell is TRUE then set a certain colour and if FALSE then set another. All this accomplished without any need for code.
zaza
-
May 1st, 2007, 09:54 PM
#7
Thread Starter
Member
Re: How to fill color in a particular Excel cell ??
Hey thx zaza..
I'll try to find out more on this..
cheers
Abhilash
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|