Consulting

Results 1 to 4 of 4

Thread: Solved: Selecting Non-adjacent columns

  1. #1

    Solved: Selecting Non-adjacent columns

    I am formatting a couple of nonadjacent columns the same way. Is there a way that I can select them together, so I only have to make the format chages one time?

    Thanks
    Matt

    E.g

    Columns("A:A").Select
    With Selection.Font
    etc etc
    End With

    Columns("D"Select
    With Selection.Font
    etc ect
    End With

    etc etc

  2. #2
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    [VBA]Worksheets(1).Range("a:a,c:c,e:e").Font.Bold = True[/VBA]

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    or:
    [VBA]Worksheets("Sheet1").Range("A:A,C:C,F:F").Font.Bold = True[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You can also copy and PasteSpecial formats.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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