The main thing is that you've got it working.
You have to remember to use the reference to that particular sheet at the proper places.
more than likely will give wrong results if another sheet is the active sheet.Sheets("Sheet1").Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
It needs the 2nd reference like
That's where the "sh1" comes in, a lot less typing!Sheets("Sheet1").Range("A1:A" & Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row)