Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Enhance sub to paste charts as well

Requesting help to enhance the sub below
There are some charts on the sheet (linked to the data on the same sheet)
that I would like pasted as well when the sub iterates through the DV in B3.
How could the sub be revised to do this? Thanks
----------------
Sub RunBatch()
'Tom Ogilvy
Dim sh As Worksheet, s As String
Dim sh1 As Worksheet, r As Range
Dim v As Range, i As Range
Set sh = ActiveSheet
Set r = sh.Range("B3")
s = r.Validation.Formula1
Set v = Range("Branch")
For Each i In v
r.Value = "'" & i
Application.Calculate
Worksheets.Add After:=Worksheets(Worksheets.count)
Set sh1 = Worksheets(Worksheets.count)
sh.Cells.Copy
sh1.Cells.PasteSpecial xlValues
sh1.Cells.PasteSpecial xlFormats
sh1.Name = i.Text
sh1.Range("B3").Validation.Delete
Next
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Enhance sub to paste charts as well

you could try to copy the sheet instead

this is an idea ...you shpould be able to adapt it easily enough
Dim sheetcount As Long
sheetcount = WorkSheets.Count
Sh.Copy After:=WorkSheets(sheetcount)



"Max" wrote:

Requesting help to enhance the sub below
There are some charts on the sheet (linked to the data on the same sheet)
that I would like pasted as well when the sub iterates through the DV in B3.
How could the sub be revised to do this? Thanks
----------------
Sub RunBatch()
'Tom Ogilvy
Dim sh As Worksheet, s As String
Dim sh1 As Worksheet, r As Range
Dim v As Range, i As Range
Set sh = ActiveSheet
Set r = sh.Range("B3")
s = r.Validation.Formula1
Set v = Range("Branch")
For Each i In v
r.Value = "'" & i
Application.Calculate
Worksheets.Add After:=Worksheets(Worksheets.count)
Set sh1 = Worksheets(Worksheets.count)
sh.Cells.Copy
sh1.Cells.PasteSpecial xlValues
sh1.Cells.PasteSpecial xlFormats
sh1.Name = i.Text
sh1.Range("B3").Validation.Delete
Next
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Enhance sub to paste charts as well

Thanks, Patrick.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/Paste Charts; Define Destination of Charts in PowerPoint ryguy7272 Excel Programming 2 January 24th 08 08:04 PM
Enhance Sort Results maperalia Excel Discussion (Misc queries) 6 January 17th 07 11:11 PM
Enhance your domain skills required for the job [email protected] Excel Programming 0 July 5th 06 04:57 AM
what do you use to enhance financial data? nicole Excel Worksheet Functions 4 May 11th 05 11:04 PM
how to enhance this macro (really short) Bob Phillips[_5_] Excel Programming 1 September 9th 03 11:43 PM


All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"