• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Copy and paste a chart without taking into account your ID name on the sheet 2|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Copy and paste a chart without taking into account your ID name on the sheet 2|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosCopy and paste a chart without taki…
sp_PrintTopic sp_TopicIcon
Copy and paste a chart without taking into account your ID name on the sheet 2
Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
1
November 6, 2018 - 2:16 am
sp_Permalink sp_Print

Hello everyone My name is A.Maurizio
My problem is this: On Sheet 1 of Excel I created a Chart following indications from the Cella (A2: C13) and so far everything is OK.
Then using the vba code I created a function that transfers the newly created Chart to sheet 2.
Now my question is this: Since if I insert an object Key, Shapers, Chart etc ...!
and then the elimino from sheet 1
And then I insert another new one; The application itself renames me this object with a different ID from the previous one.
So my question is this: There would be a system always taking advantage of the VBA rather than writing the Sample Function (Worksheets ("Sheet1"). Shapes ("Chart 17"). Copy) where it is clearly highlighted that even the chart created by Nuovo would give me an error because the previous Chart was always called for example (Chart 16). There would not be a way that the procedure does not take into account the name and let me copy my ciart anyway on Sheet 2
Thanks from Now for All the help you will be willing to give me on Sincere Greetings from A.Maurizio

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 615
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
2
November 6, 2018 - 11:52 pm
sp_Permalink sp_Print sp_EditHistory

Assuming it's the only chart on the sheet, you can use this:

Sub Copia_Immagine_Chart_Sul_Foglio2()
Dim MyChart
Worksheets("Foglio1").ChartObjects(1).Copy
Worksheets("Foglio2").Paste Destination:=Worksheets("Foglio2").Range("A3")
Worksheets("Foglio1").Range("A3").Copy Destination:=Worksheets("Foglio2").Range("A3")
Foglio2.Range("A3").Clear

Worksheets("Foglio1").ChartObjects(1).Delete
End Sub

By the way, I don't understand why you copy and paste A3 and then clear it again?
Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 202
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
3
November 7, 2018 - 8:51 pm
sp_Permalink sp_Print

Hello Velouria
Thank you for your practical and technical support
Your function is very interesting
But to re-address your question; Quote: ("Why Copy a cell on Sheet 2, then Cancel it!")
Answer: Because not only initially without paying much attention to the formality of my work; I also took into consideration the fact of Copying the entire section of cells that had allowed me to create the Chart.
Then at a later moment I realized that it was a silly thing to copy everything; When: Not only did I already have the original data on sheet 1; But also because it would not have served me as a source, as I only wanted the Created Chart.
That's all !!!!!!

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Richard West, Shanna Henseler, Lawrence Smith, Nada Perovic
Guest(s) 12
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6212
Posts: 27236

 

Member Stats:
Guest Posters: 49
Members: 31889
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.