Results 1 to 4 of 4

shorthand - formatting

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    shorthand - formatting

    any suggestions on how to write this 'formatting' code in a more compact form ... ive got alot of formatting to do and its taking up alot of real estate on the page:

       
        Worksheets("PW_TRI").Select
        Range("G2:AD134").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        
       With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        Selection.NumberFormat = "0.00"
        Range("AE2:AE134").Select
        Range("AE134").Activate
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
        
       With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlInsideVertical)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        With Selection.Borders(xlInsideHorizontal)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlThin
        End With
    
        Range("AF1").Select
      
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
      
    
        Range("A1:AE134").Select
        Selection.Borders(xlDiagonalDown).LineStyle = xlNone
        Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    
        With Selection.Borders(xlEdgeLeft)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
    
        With Selection.Borders(xlEdgeTop)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
    
        With Selection.Borders(xlEdgeBottom)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
    
        With Selection.Borders(xlEdgeRight)
            .LineStyle = xlContinuous
            .ColorIndex = 0
            .TintAndShade = 0
            .Weight = xlMedium
        End With
    
        Range("G2").Select
    
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    
        Sheets("PW_TRI").Range("D2:AE2").Select
        Range(Selection, Selection.End(xlDown)).Select
    
        With Selection
         .HorizontalAlignment = xlCenter
         .VerticalAlignment = xlCenter
         .Orientation = 0
         .AddIndent = False
         .IndentLevel = 0
         .ShrinkToFit = False
         .ReadingOrder = xlContext
         .MergeCells = False
        End With
    
        With Selection.Font
         .Size = 8
         .Strikethrough = False
         .Superscript = False
         .Subscript = False
         .OutlineFont = False
         .Shadow = False
         .Underline = xlUnderlineStyleNone
         .TintAndShade = 0
        End With
    Last edited by intothewild; 05-01-2014 at 04:39 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Convert MMM DD, YYYY hh:mm:ss GMT -06:00 to shorthand format
    By kolfinna in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2013, 02:42 PM
  2. Target with Range Shorthand
    By JasonEPerkins in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-18-2007, 10:11 AM
  3. Need to write IF formula in shorthand
    By MikeX in forum Excel General
    Replies: 5
    Last Post: 08-27-2007, 02:35 PM
  4. Macro to replace shorthand fields with data from another table?
    By khigh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2007, 01:23 PM
  5. Is there a shorthand for listing many consecutive values in an array?
    By fbarbie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-01-2005, 10:47 AM

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