Hi, WayneCa,
the typical situiation: you deliver a couple of information not covering everything you want to do, and we donīt know what you want to do as we are based on the inforamtion given.
I would only rely on the index of a sheet if I know that there is only one sheet in the workbook. Rather Iīd rely on the codename of the sheet which is not the name seen on the worksheet tab but in the project explorer in the VBE.
I usually test my codes with 2 or three numbers to see if itīs okay, no matter on how otīs posted here in the forum. And as I do not have a real printer installed I usually use PrintPreview in order to see the result onscreen before even daring to have paper run through any printer.
Assuming the codename for the sheet is
shtPrint then the code may look like this:
The values for both constants may be adapted to suit as well as the range for the date, I would recommend to set them as low as possible for testing the code (say 2 for each) or use PrintPreview prior to a live test.
There is absolutely no need to merge cells, no matter what youīre argument for them should be. Use the address of tehe first cell of the merged area as the other addresses would not fill in the information.
Ciao,
Holger
Bookmarks