you have the code, just use a range instead of activesheet
activesheet
e.g. Sheets("Sheet1").Range("B2:H28").ExportAsFixedFormat ...
Sheets("Sheet1").Range("B2:H28").ExportAsFixedFormat ...