+ Reply to Thread
Results 1 to 3 of 3

Copy/Paste Drawing Objects

  1. #1
    Registered User
    Join Date
    03-27-2009
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    4

    Copy/Paste Drawing Objects

    I have workbook with circle to which excel2007 has assigned the range name "Oval 1". It is in the Sheet1 tab in the work book. code copies and pastes it to Sheet2 tab. When this is done, excel2007 assigns the range name "Oval 1" to it. It is then pasted to another cell in Sheet2 and it becomes "Oval 2". THAT'S ONE BEHAVIOR.

    In another workbook, the exact same thing is being done with the same kind of code and BOTH objects in the Sheet2 are called "Oval 1".

    WHY IS THAT? WHAT CONTROLS THIS BEHAVIOR?

    Here's the code:
    Sheets("Sheet1").Select
    ActiveSheet.DrawingObjects("Oval 1").Select
    Selection.Copy
    Sheets("Sheet2").Select
    Range("CellforOval1").Select
    ActiveSheet.Paste

    Range("CellforOval1").Offset(5, 0).Select
    ActiveSheet.Paste

    Thanks

  2. #2
    Forum Contributor
    Join Date
    03-12-2009
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 365
    Posts
    236

    Re: Copy/Paste Drawing Objects

    Look into your named ranges to figure out what CellforOval1 is.
    If you can't figure out how a formula works, try stepping through it using "Evaluate Formula" in the Formula Auditing menu item in the tools menu!

    If you want to see where your code went wrong, try stepping through it by clicking in the code and pressing F8 and watch as the magic happens!


    If you are happy with any of the results, please add to the contributor's reputation by clicking the star icon.

  3. #3
    Registered User
    Join Date
    03-27-2009
    Location
    Seattle, Washington
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Copy/Paste Drawing Objects

    Thanks for your reply Everstrivin. Cell4Oval1 is just a named range I created so I could go to that cell on Sheet2 to paste the "Oval 1" drawingobject. It has no effect on the behavior I am trying to understand. Both workbooks contain the exact same worksheets, named ranges, drawingobjects and code, but they behave differently. I don't know why. Something else has been set somewhere...., but, where?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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