Stepping through code

Godders199

Active Member
Joined
Mar 2, 2017
Messages
313
Office Version
  1. 2013
Hello, is there an easy way to establish which element of the code is formating down to row 50000, when on max of 8000 rows are used. the code is very long, so not suitable to add here, I have been through and changed all column references to ranges, and every calculation uses the lastrow so i now its not them.

I use f8, i would be pressing it all day.

when i press ctrl end it gos to av49999, if i could just find out which column is causing this it would help.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Instead of using F8 to step through the code line-by-line, you could insert break points, so you can run your code "up to a certain point".
If you insert multiple break points, then stop your code and check where the last row is at that point, you can narrow it down to the section of code that is causing that to happen.

Other than that, it really is a matter of reading your code, and understanding what each part is doing. Obviously, if we cannot see the code, we cannot do that.
 
Last edited:
Upvote 0
You could also search the code for 49999. Its not necessarily there but you cant do a CTRL-F in vba just as you can on the worksheet.
 
Upvote 0
You could also use Debug.Print to output the addresses of the ranges that are being formatted.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top