I am trying to sort the values in rows 3 through the end of the column in a worksheet (named "parms") using VBA:
It seems to work fine when lastline > 3 (i.e., it properly sorts I3 through the end of the column), but when lastline = 3, it goes rogue and not only sorts I1:I3 instead of I3:I3 but also sorts H1:H3 and G1:G3. What the heck is going on?![]()
lastline = Range("parms!I" & Rows.Count).End(xlUp).Row ' the last line in I that has data Range("parms!I3:I" & lastline).Sort Range("parms!I3:I" & lastline)
Bookmarks