Copy only some existing worksheets to a new workbook
Hi,
Thanks for that - it almost worked.
It's now copying each spreadsheet to a seperate workbook whereas I wanted
them in one workbook.
exceluserforeman wrote:
Hi,
Rather that looking for the sheets to copy, why not look for the sheets not
to copy?
dim intNum, intCount as integer
dim strSheetNamer1, shtName2 as string
strSheetName1="Not This One"
strSheetName2="Or This One"
intCount=sheets.count
for intNum=1 to intCount-2
'minus 2 because of those 2 you do not want
if sheets(intNum) .name<strSheetName1 or _
sheets(intNum) .name<strSheetName2 _
then
sheets(intNum).Copy
'to whereever
end if
next intnum
Hi,
[quoted text clipped - 51 lines]
Sheets(Array(worksheet_to_copy)).Select
Sheets(Array(worksheet_to_copy)).Copy
|