I am using Excel 2003. I have some code that works just fine when I want to get the page count from one tab, but when I add code for multiple tabs I get the following error when it gets to the paste command: Run-time error '1004: That command cannot be used on multiple selections. Is there a way to get a page count while selecting multiple tabs? Thanks in advance.
Code:
Windows(CinFileName & ".xls").Activate
Application.CutCopyMode = False
Sheets(Array("Confrpt", "PE Phase")).Select
Pgs = ActiveSheet.PageSetup.Pages.Count
Selection.Copy
Windows("CloneConfrpt_TOC.xls").Activate
Range("H" & Rows.Count).End(xlUp).Offset(1).Value = Pgs
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False