Zach,
Thank you so much for taking the time to reply to me. I tried your first sub and it does the same thing, it finds the last row that includes the hidden rows outside of column L. The second one is close, it finds the rows but is missing a few. This worksheet has some items with a sub total, discount, and total in columns J-L. It finds the last row just above the totals and does not include them.
On the third example I am getting a "Subscript out of range" error on the line - With Workbooks(CurName).Sheets("Sheet1")
I tried just changing the copyarea in the original code to :Workbooks(CurName).Activate
Range("A1").Activate
ActiveSheet.UsedRange.Select
rowscount = Selection.Rows.Count
'Set CopyArea = Range("A1", ("L" & rowscount))
Set CopyArea = .Range("A1", "L" & .Cells(.Rows.Count, 1).End(xlUp).Row)
CopyArea.Select
Get_Col_Widths 'used to set the column width, this is being copied to a new workbook
I get an error "Invalid or unqualified reference " and it highlights .rows
I am editing someone else's code and trying to learn this as I go.
Lori
Bookmarks