+ Reply to Thread
Results 1 to 7 of 7

VBA format as table with custom colours and alignment

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    southampton
    MS-Off Ver
    Excel 2003
    Posts
    76

    VBA format as table with custom colours and alignment

    Hi all,

    A bit of a VBA challenge here. I'm trying to find a code that will;

    1. change cell colour of first row of selected cells to hex code (123,0,0) [row header]
    2. change text colour of first row of selected cells to white and bold [row header]
    3. add All Borders to selected cells
    4. add Thick Outside boarder to selected cells
    5. add Thick Outside boarder to first row of selected cells
    6. Center Align and Middle Align selected cells
    7. add filter to selected cells

    Any help would be very gratefully received!
    Last edited by ld2x07; 01-09-2018 at 10:50 AM. Reason: solved

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: VBA format as table with custom colours and alignment

    Have you considered creating a table theme and applying that?
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  3. #3
    Registered User
    Join Date
    05-14-2013
    Location
    southampton
    MS-Off Ver
    Excel 2003
    Posts
    76

    Re: VBA format as table with custom colours and alignment

    Hi thanks for the response. I am compiling useful work-related VBAs for a personal.xlsb that I can share with colleagues as a file.

    Not to worry I'm almost there, just trying to find the part that will do the boarders.

    Once complete I'll post on here for reference.

  4. #4
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: VBA format as table with custom colours and alignment

    Ah, context.

    You may consider then writing the code so that it saves the table format as a table style. This way they can use that style of table without needing code in other files and recipients of said files can also use the table style within those files without running a macro. You could further extend it in the future, should you need, to have the code generate multiple table styles instead of a single on.

  5. #5
    Registered User
    Join Date
    05-14-2013
    Location
    southampton
    MS-Off Ver
    Excel 2003
    Posts
    76

    Re: VBA format as table with custom colours and alignment

    Interesting idea, thanks for the thought. I'll give it a crack

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA format as table with custom colours and alignment

    Perhaps this
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  7. #7
    Registered User
    Join Date
    05-14-2013
    Location
    southampton
    MS-Off Ver
    Excel 2003
    Posts
    76

    Re: VBA format as table with custom colours and alignment

    Nailed it, thanks

+ 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. Replies: 7
    Last Post: 01-31-2016, 07:45 AM
  2. Replies: 1
    Last Post: 10-17-2012, 09:18 AM
  3. Replies: 1
    Last Post: 02-02-2012, 11:32 AM
  4. Excel 2008 : Custom Theme Colours
    By TPS Tom in forum Excel General
    Replies: 0
    Last Post: 07-27-2011, 12:14 PM
  5. Custom Cell Format - Any Reference Table ?
    By jeremymc7 in forum Excel General
    Replies: 1
    Last Post: 07-29-2008, 02:21 PM
  6. Custom format & Alignment
    By MattShoreson in forum Excel General
    Replies: 3
    Last Post: 11-02-2006, 08:25 AM
  7. [SOLVED] can you set custom colours to be used in excel charts
    By katet in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-10-2006, 04:00 PM

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