Originally Posted by
Kenneth Hobs
Welcome to the forum! Did you get an answer in the other forum(s) that you posted this to?
You can do an If() to check the worksheet's Index value to do the loop or not. You do a loop to check for paste:
IF PasteType=2 then
PPSlide.Shapes.PasteSpecial PasteType 'ppPasteEnhancedMetafile
Else
ppSlide.Shapes.Paste.Select
End If
Hi Kenneth, thanks for your reply! I've tried it out and it worked like a charm. Someone else proposed the following, which also worked.. However within your line of code I can also change the formatting of both types of pasteTypes (for example I can now adjust the sizes of all pictures). So thanks a lot for this!
Dim PasteType as String PasteType = xlwksht.Range("C1").Value 'Where C1 = "ppPasteEnhancedMetafile"
PPSlide.Shapes.PasteSpecial (PasteType)
However the second question is still a mystery for me.. I can't get the same principle working to skip the first excel sheet (or more). I've tried the following:
For Each xlwksht In ActiveWorkbook.Worksheets
If xlwksht.Name = "Sheet1" Then
Else
MyRange = xlwksht.Range("A1").Value & ":" & xlwksht.Range("A2").Value
xlwksht.Range(MyRange).Copy
End If
But this doesn't work.. Do you maybe have a clue how to fix the error I am making?