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

    copy without button.. (2000 sr-1)

    i use this piece of code to copy line from sheet to other sheet...
    In this range is present a button.
    How to copy only the line without button?
    ........
    Sheets(FOGLIO).Range("A1:V2").Select
    Selection.Copy
    .........

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

    Re: copy without button.. (2000 sr-1)

    If you never want to copy buttons and other objects with cells, you can turn of the option "Cut, copy and sort objects with cells" in the Edit tab of Tools | Options...
    If you want to turn it off in code, use:

    Application.CopyObjectsWithCells = False

    You can also restore the original setting if you like:

    ' Declare variable
    Dim blnCopyObjects As Boolean
    ' Store current setting in variable
    blnCopyObjects = Application.CopyObjectsWithCells
    ' Turn off
    Application.CopyObjectsWithCells = False
    ' Your code goes here
    ...
    Sheets(FOGLIO).Range("A1:V2").Copy
    ...
    ' Restore original setting
    Application.CopyObjectsWithCells = blnCopyObjects

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy without button.. (2000 sr-1)

    I love you!
    Tks as usual.

  4. #4
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy without button.. (2000 sr-1)

    Hans sorry me... i am not sure...
    Sub RICOPIA_TITOLI_1(FOGLIO)

    Sheets("TEMPLATE_2").Visible = True

    Sheets(FOGLIO).Select
    ' Declare variable
    Dim blnCopyObjects As Boolean
    ' Store current setting in variable
    blnCopyObjects = Application.CopyObjectsWithCells
    ' Turn off
    Application.CopyObjectsWithCells = False
    ' Your code goes here
    Sheets(FOGLIO).Range("A1:V2").Select
    ' Restore original setting
    Application.CopyObjectsWithCells = blnCopyObjects

    Selection.Copy
    Sheets("TEMPLATE_2").Select
    Range("A1").Select
    ActiveSheet.Paste
    Range("A3").Select
    Sheets(FOGLIO).Select
    Application.CutCopyMode = False
    Range("A3").Select
    Call Macro4(FOGLIO)

    End Sub

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

    Re: copy without button.. (2000 sr-1)

    You must restore the original setting after copying and pasting.

  6. #6
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: copy without button.. (2000 sr-1)

    NOW WORK FINE!!!
    Tks.

Posting Permissions

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