On each sheet, define a Name ("Named Range") that contains what you want to copy:
Select the range.
On the Formulas tab, click Define Name.
In the dialog, enter a name, something like RangeToCopy
In the dropdown for Scope, select the active sheet's name.
Use the amended code:
Set pptApp = CreateObject("PowerPoint.Application")
Set pptPre = pptApp.Presentations.Add
' loop the sheets
For Each objSheet In ActiveWorkbook.Worksheets If WorksheetFunction.Count(objSheet.UsedRange) > 0 Then
' Data in sheet so copy used range
objSheet.Range("RangeToCopy").CopyPicture Appearance:=xlScreen, Format:=xlPicture
Else
' No data in sheet, so copy chart
objSheet.ChartObjects(1).Chart.CopyPicture Appearance:=xlScreen, Size:=xlScreen, Format:=xlPicture
End If
'Create new slide for the data
Set pptSld = pptPre.Slides.Add(pptPre.Slides.Count + 1, ppLayoutBlank)
' paste the copied picture
pptSld.Shapes.Paste
Next