I don't have any real knowledge of writing code and am only fairly familiar with macros. A coworker recorded a very lengthy macro that I've been adding to, but I've run into a snag with some formatting/auto-fill things she has in the macro. In the simplest of terms, she has the formatting/auto-fill ending at 5000 lines. I can see everywhere in the code that she has done this, but I'm not sure how to change it so it'll function the way we need it to. Sometimes the report is less than 5000 lines and sometimes it's greater. So everywhere that she has specified '5000' lines needs to be changed in someway so that it will vary based on the data in the report being ran. If that makes sense? Here are some snipits from the code:

Columns("G:G").EntireColumn.AutoFit
Range("G2").Select
Selection.AutoFill Destination:=Range("G2:G5000"), Type:=xlFillDefault
Range("G2:G5000").Select


Selection.AutoFill Destination:=Range("J2:J5000"), Type:=xlFillDefault
Range("J2:J5000").Select

I feel like I just need to change the range to something that varies rather than 5000 but I can't figure out how that's done? I feel like it would be something silly like Range("J2:JVariable")

Please help if you can! THANK YOU!