Consulting

Results 1 to 2 of 2

Thread: Macro to format borders within tables in Excel file

  1. #1
    VBAX Newbie
    Joined
    Oct 2011
    Posts
    1
    Location

    Question Macro to format borders within tables in Excel file


    A link posted in another thread on this site comes very close to what I'm trying to accomplish in my worksheet. Since I'm unable to post the link in my description, I listed it in the attached Excel file.

    If you open my attached file, you'll see exactly what I'm trying to accomplish concerning the borders. Any help is greatly appreciated. Thanks!
    Attached Files Attached Files

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    I don't see the problem. The Sub xlBorders provided in the kb article, http://www.vbaexpress.com/kb/getarticle.php?kb_id=499, is pretty straight forward. Just put the Sub into a module or copy the whole module as use what you need.

    Like the examples, just tell your Sub to call it and pass the 3 required input parameters. For example, inserting an ActiveX commandbutton via the Developer tab, the code for the active sheet's used range would be:
    [VBA]Private Sub CommandButton1_Click()
    xlBorders ActiveSheet.UsedRange, "thick", "thin"
    End Sub[/VBA]

Posting Permissions

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