Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by cashonly
at 2024-08-02 05:14:32
Point:500 Replies:5 POST_ID:828664USER_ID:11548
Topic:
Microsoft Excel Spreadsheet Software;;
I have a chart in a workbook. What I would like to do, thru VBA, is take a "snapshot" of that chart and paste that snapshot in another workbook.
If I could do it by somehow getting the actual chart, without having to reference the original workbook, that would be great if it's not too complicated. If not, even grabbing an image of the chart would work. Any suggestions?
If I could do it by somehow getting the actual chart, without having to reference the original workbook, that would be great if it's not too complicated. If not, even grabbing an image of the chart would work. Any suggestions?
Author: cashonly replied at 2024-08-02 06:35:44
yahooooo,
I'm working with an existing chart, so I modified your code:
I'm working with an existing chart, so I modified your code:
Sub CreateAndCopyChart() Dim ws As Worksheet Dim cht As Chart Set ws = Workbooks(2).Worksheets("PistCnvLSIdxMomLo-1-SMRY") Set cht = ws.ChartObjects(1).Chart cht.ChartArea.Copy Workbooks(3).Worksheets(2).Range("A2").PasteSpecial xlPasteValuesend sub 1:2:3:4:5:6:7:8:9:10:11:
This solution works best for my needs.
Thank you.
Expert: Rgonzo1971 replied at 2024-08-02 05:30:55
Hi
Or as a Picture
Or as a Picture
Sub Makro4() ActiveChart.ChartArea.Copy Range("A1").Activate ActiveWorkbook.ActiveSheet.Pictures.Paste.SelectEnd Sub 1:2:3:4:5:6:
Regards
Expert: aikimark replied at 2024-08-02 05:25:34
In certain cases, you might also consider using the Excel camera object
Expert: duncanb7 replied at 2024-08-02 05:22:13
Label the Excel chart for Chart 1
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.ChartObjects("Chart 1").Copy
on other sheet
=====
range("A1").Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.ChartObjects("Chart 1").Copy
on other sheet
=====
range("A1").Paste
Accepted Solution
Expert: yahooooo replied at 2024-08-02 05:20:55
500 points EXCELLENT
Sub CreateAndCopyChart()Dim ws As WorksheetDim cht As ChartSet ws = ThisWorkbook.Worksheets("Graphs")Set cht = ws.Shapes.AddChart.ChartWith cht .SetSourceData ws.Range("$B$21:$C$22") .ChartType = xl3DPie .ChartArea.CopyEnd Withws.Range("A2").PasteSpecial xlPasteValuescht.Parent.DeleteEnd Sub 1:2:3:4:5:6:7:8:9:10:11:12:13:14: