Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Omit copying objects? (Excel 2002/2003)

    Hi

    The macro below copies and pastes to a new workbook, unfortunately it also copies the button objects ie Command Buttons and Form Buttons I would like to omit these from being copied.

    Sub PricingForm()
    '
    ' PricingForm Macro

    '
    ProdSheetSort
    ActiveSheet.Unprotect Password:="password"
    Range("A1:G761").Select
    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
    Cells.Select
    Cells.EntireColumn.AutoFit
    Selection.ColumnWidth = 29.5
    Range("A20").Select
    Application.CutCopyMode = False
    With ActiveWindow
    .DisplayGridlines = False
    .DisplayZeros = False
    End With
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 4
    ActiveWindow.ScrollColumn = 3
    ActiveWindow.ScrollColumn = 2
    ActiveWindow.ScrollColumn = 1
    End Sub

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Omit copying objects? (Excel 2002/2003)

    Hi

    Sorry I was a bit hasty posting this I have resolved it with Application.CopyObjectsWithCells = False

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

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