+ Reply to Thread
Results 1 to 8 of 8

how to do fill color for multiple rows and columns

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    columbus,oh
    MS-Off Ver
    Office 365
    Posts
    190

    how to do fill color for multiple rows and columns

    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!

  2. #2
    Registered User
    Join Date
    03-19-2014
    Location
    India
    MS-Off Ver
    Excel & VBA - 2007 & 2010
    Posts
    60

    Re: how to do fill color for multiple rows and columns

    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

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: how to do fill color for multiple rows and columns

    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

  4. #4
    Forum Contributor
    Join Date
    08-22-2013
    Location
    columbus,oh
    MS-Off Ver
    Office 365
    Posts
    190

    Re: how to do fill color for multiple rows and columns

    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

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    columbus,oh
    MS-Off Ver
    Office 365
    Posts
    190

    Re: how to do fill color for multiple rows and columns

    @fDibbins This is a part of some macro that I am trying to write, that's why not doing it manually.

  6. #6
    Registered User
    Join Date
    03-19-2014
    Location
    India
    MS-Off Ver
    Excel & VBA - 2007 & 2010
    Posts
    60

    Re: how to do fill color for multiple rows and columns

    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
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-22-2013
    Location
    columbus,oh
    MS-Off Ver
    Office 365
    Posts
    190

    Re: how to do fill color for multiple rows and columns

    Thank you !

  8. #8
    Registered User
    Join Date
    03-19-2014
    Location
    India
    MS-Off Ver
    Excel & VBA - 2007 & 2010
    Posts
    60

    Re: how to do fill color for multiple rows and columns

    You Welcome.

    If you like my Response:
    1. Show appreciation to those who have helped you by clicking "* Add Reputation" below their posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. New Excel User need help on hiding rows that have no fill color in any of the columns
    By kellynicolebarrett in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-16-2014, 03:13 AM
  2. Delete Columns and rows based on cell fill color
    By JackW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2014, 01:58 PM
  3. Macro VB for Formula Fill Through Several Rows in Multiple Columns
    By sanjeevpandey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2013, 11:04 AM
  4. Macro to Fill Specific Rows and Columns with Color Based on Cell Value
    By MSmithson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-04-2011, 09:45 PM
  5. color fill rows?
    By tgs23lax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2007, 03:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1