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????
 
L

Legacy 51064

Guest
Are you able to post your code, so that we can see what is causing your problem?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,288
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?
 

TB

Board Regular
Joined
Jul 18, 2005
Messages
68
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.
 

TB

Board Regular
Joined
Jul 18, 2005
Messages
68
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!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,288
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.
 

TB

Board Regular
Joined
Jul 18, 2005
Messages
68
Great, Norie. It is working for me already (I think I am beginning to identify part of the problem).

As, always - thanks!
 

Forum statistics

Threads
1,078,532
Messages
5,341,016
Members
399,409
Latest member
Winfield Ullrich I

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top