Simple VBA Question

TB

Board Regular
Joined
Jul 18, 2005
Messages
68
This is a simple question, I have just never had to do it (because I am a self-taught amateur VBA'er). I have code that is stalling and I can't' seem to figure out where it is getting caught up. I know that there is a way I can run my code line-by-line so that I can figure out where the hang up is, I just don't know how.

Help????
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Are you able to post your code, so that we can see what is causing your problem?
 
Upvote 0
You can step through code using F8.

You can also set up breakpoints in the code by pressing F9.

How is the code stalling? Are you getting errors?
 
Upvote 0
I can, but it is a quite lengthy and I am sure if I print it and dig into it I will find the problem. I was just thinking that I really DO need to learn how to run my code line by line (seems like a VBA 101 request, I know). That is why I posted the question. Can you help? If so, I would really appreciate it.
 
Upvote 0
Thanks, Norie!

No, I am not getting errors. I think it is stuck in a neverending loop (program doesn't stop - just runs forever). The code was fine until recently. I think I must have accidentally hit a key on my keyboard before saving the code and didn't realize it. I am sure that I will find it soon.

When stepping through the code, when do I press F8 - after clicking run or just click F8 and that will get it going?

Thanks!
 
Upvote 0
Put the cursor somewhere within the code and press F8.

By the way this will step through every line of code and every iteration of any loops.
 
Upvote 0
Great, Norie. It is working for me already (I think I am beginning to identify part of the problem).

As, always - thanks!
 
Upvote 0

Forum statistics

Threads
1,214,619
Messages
6,120,550
Members
448,970
Latest member
kennimack

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