Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy ColumnWidth (2000 sr-1)

    i use this code but not work... from LUST10A to TEMPLATE_1
    Sub Macro3()

    Columns("A:V").Select
    Selection.Copy

    Sheets("TEMPLATE_1").Select
    Columns("A:A").Select

    Selection.PasteSpecial Paste:=xlColumnWidths, Operation:=xlNone, _
    SkipBlanks:=False, Transpose:=False

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy ColumnWidth (2000 sr-1)

    1) In Excel 2003, you must use xlPasteColumnWidths instead of xlColumnWidths.
    2) It isn't necessary to select cells:

    Sub Macro3()
    Sheets("TEMPLATE_1").Select
    Sheets("LUST10A").Columns("A:V").Copy
    Sheets("TEMPLATE_1").Columns("A:A").PasteSpecial Paste:=xlPasteColumnWidths
    End Sub

    If you remove the code to select cell A3 from the worksheet modules, you can even omit the line

    Sheets("TEMPLATE_1").Select

Posting Permissions

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