Excel to Powerpoint Macro Modifications

ccline

New Member
Joined
Mar 1, 2011
Messages
4
Hello Excel Gurus,

I found the following macro that works extremely well for Excel to PPT coversion:
Code:
Sub UsedRangePPT()

Dim objPPT As Object
Dim shtTemp As Object
Dim intSlide As Integer

Set objPPT = CreateObject("Powerpoint.application")
objPPT.Visible = True
objPPT.Presentations.Add
objPPT.ActiveWindow.ViewType = 1 'ppViewSlide


For Each shtTemp In ThisWorkbook.Sheets
shtTemp.Range("A1", shtTemp.UsedRange).CopyPicture xlScreen, xlPicture
intSlide = intSlide + 1
' new slide for each chart
objPPT.ActiveWindow.View.GotoSlide Index:=objPPT.ActivePresentation.Slides.Add(Index:=objPPT.ActivePresentation.Slides.Count + 1, Layout:=12).SlideIndex
objPPT.ActiveWindow.View.Paste
With objPPT.ActiveWindow.View.Slide.Shapes(objPPT.ActiveWindow.View.Slide.Shapes.Count)
.Left = (.Parent.Parent.SlideMaster.Width - .Width) / 2
End With
Next

Set objPPT = Nothing
End Sub
Code:
I am using the following:
- MS Excel 2007
- Windows XP

My questions ares:
1. How do I change the above macro to only export a specific range into powerpoint? When I run this macro, it exports all sheets used range?
2. My workbook has 25 sheets but I only want 19 sheets to export. The other 6 sheets are reference or data tabs not for presentation.
3. How do I format each sheet to fit properly onto a slide within the macro or does this need to be handled manually?

Thanks!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,559
Messages
6,179,517
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top