I want to write a macro to fill color in row 8 of the worksheet as solid black .
Also columns P,T,AP,BC ,BE and BG should be filled solid black and width should be 1 for the row and the column.
Help!
I want to write a macro to fill color in row 8 of the worksheet as solid black .
Also columns P,T,AP,BC ,BE and BG should be filled solid black and width should be 1 for the row and the column.
Help!
Hello,
Please find the code example for two columns, you can add more columns as per your requirement.
![]()
Please Login or Register to view this content.
Thanks!
Moinuddin Shaikh
If you like my Response:
1. Show appreciation to those who have helped you by clicking below their posts.
2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.
Appreciate someone towards their career path is better than saying Thanks!
-Moin
If thats all you want, why not just fdo it manually?
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
This is how i modified it for my ranges.
It resizes the columns but doesn't fill them with solid color.
Also how can I specify row 8 to be the same fill and size as those columns.
Sub Color()
Range("$P:$P").Select
Range("$T:$T").Select
Range("$AP:$AP").Select
Range("$AT:$AT").Select
Range("$BC:$BC").Select
Range("$BG:$BG").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("P:P,T:T,AP:AP,AT:AT,BC:BC,BG:BG").Select
Range("P:P,T:T,AP:AP,AT:AT,BC:BC,BG:BG").Activate
Selection.ColumnWidth = 1
End Sub
@fDibbins This is a part of some macro that I am trying to write, that's why not doing it manually.
Hi,
First of all, whenever you add any codes in the thread. Kindly use the code functions.
And, regarding your coding....i have amend it. please try the below codes.
For example, i have also attached the spreadsheet.
![]()
Please Login or Register to view this content.
Thanks!
Moinuddin Shaikh
If you like my Response:
1. Show appreciation to those who have helped you by clicking "* Add Reputation" below their posts.
2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.
Appreciate someone towards their career path is better than saying Thanks!
-Moin
Thank you !
You Welcome.
If you like my Response:
1. Show appreciation to those who have helped you by clicking "* Add Reputation" below their posts.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks