wolf.stalker
11-16-2011, 11:28 AM
hi all, any help would be greatful..
Here is what you need to know without me posting everything up here.
Row 1 = just column headers
Column H = containes either "U", "P", "D", or "M"
iItemCount = Application.WorksheetFunction.CountIf(Sheets("Detail").Range("B:B"), Range("B" & 2))
Range("A" & 2, "Q" & iItemCount + 1).Select
ActiveWorkbook.Worksheets("Detail").Sort.SortFields.Add Key:=Range("H" & 2, "H" & 1 + iItemCount), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
any idea why this might crash repeatedly on one particular row (around 183)? this is contained in a 1600 count loop. i have removed the "bad" rows but then it goes to the next row and crashes there....almost like the row is the issue, BUT, i am not sure how it CAN be as iItemCount has nothing to do with the row nunber?? iItemCount is just the number of times a site number is listed. :dunno
if you have any thoughts on how to fix or get around this, that would be awesome!
thank you!
Here is what you need to know without me posting everything up here.
Row 1 = just column headers
Column H = containes either "U", "P", "D", or "M"
iItemCount = Application.WorksheetFunction.CountIf(Sheets("Detail").Range("B:B"), Range("B" & 2))
Range("A" & 2, "Q" & iItemCount + 1).Select
ActiveWorkbook.Worksheets("Detail").Sort.SortFields.Add Key:=Range("H" & 2, "H" & 1 + iItemCount), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
any idea why this might crash repeatedly on one particular row (around 183)? this is contained in a 1600 count loop. i have removed the "bad" rows but then it goes to the next row and crashes there....almost like the row is the issue, BUT, i am not sure how it CAN be as iItemCount has nothing to do with the row nunber?? iItemCount is just the number of times a site number is listed. :dunno
if you have any thoughts on how to fix or get around this, that would be awesome!
thank you!