+ Reply to Thread
Results 1 to 9 of 9

change grid color

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    Taipei
    MS-Off Ver
    MS365 Version 2310
    Posts
    16

    change grid color

    Hi,

    There are two Tables in my Excel sheet.
    one is control table and the other is presentation table.
    I would like to change presentation Table's grid color by control Table.
    (as attachment)

    It seems it cannot achieve by formula only, probably the VBA is necessary to use.
    Could anyone give me hint?
    Thank you!

    B.R.
    YU
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,015

    Re: change grid color

    Why not RIGHT CLICK in Table (after selecting all cells), then FORMAT CELLS / BORDER. SELECT the line type and color, then click OK.

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    Taipei
    MS-Off Ver
    MS365 Version 2310
    Posts
    16

    Re: change grid color

    There's over hundred lines of control table.
    And presentation table is generated by another tool.
    I would like it automatically mark color but by manually.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: change grid color


    Hi,

    should be better with the expected color in column A or D for example …

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    According to the attachment a VBA demonstration as a beginner starter :

    PHP Code: 
    Sub Demo1()
            
    C% = 2
        
    For R& = 3 To [A1].End(xlDown).Row
            
    If 51 Then C Else 3
            Range
    (Cells(Cells(R1) + 213 Cells(R2)), Cells(Cells(R1) + 213 Cells(R3))).Interior.ColorIndex C
        Next
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  6. #6
    Registered User
    Join Date
    06-24-2013
    Location
    Taipei
    MS-Off Ver
    MS365 Version 2310
    Posts
    16

    Re: Try this !

    Hi Mark.

    It works, thank you so much.

    I have advance question:
    I see C%, R& in your code. What does it mean?

    Appreciated with you help.

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Try this !

    Shorthand for the type that the variable will be.

    The shorthand for the types is: % -integer; & -long; @ -currency; # -double; ! -single; $ -string

    Declaring variables
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Try this !

    Quote Originally Posted by okeyla View Post
    Hi Mark.

    I see C%, R& in your code. What does it mean?
    BASIC legacy to declare a variable type like described in previous post …

  9. #9
    Registered User
    Join Date
    06-24-2013
    Location
    Taipei
    MS-Off Ver
    MS365 Version 2310
    Posts
    16

    Re: Try this !

    Quote Originally Posted by Marc L View Post
    BASIC legacy to declare a variable type like described in previous post …
    Hi Marc:

    Sorry and thank you for helping.

+ 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. [SOLVED] Color changing: change the color of one cell, and have other cells change colors too
    By hadydea in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2019, 04:51 PM
  2. Add fill color grid to ribbon?
    By MetroBOS in forum Excel General
    Replies: 2
    Last Post: 05-19-2017, 09:42 AM
  3. Preserving grid lines when color filling?
    By Fernando12 in forum Excel General
    Replies: 2
    Last Post: 07-10-2007, 02:47 PM
  4. Replies: 2
    Last Post: 08-21-2006, 11:55 AM
  5. [SOLVED] No grid lines with color
    By BK in forum Excel General
    Replies: 2
    Last Post: 06-22-2006, 05:10 PM
  6. [SOLVED] How do I change the orange color of the grid address highlight?
    By 140WWR068512232 in forum Excel General
    Replies: 3
    Last Post: 06-13-2005, 11:05 PM
  7. Be able to re-color INDIVIDUAL grid lines in excel charts
    By John Canino in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-15-2005, 01:06 AM

Tags for this Thread

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