Values Disappear Unless Stepping Into

vthokienj

Board Regular
Joined
Aug 1, 2011
Messages
105
Office Version
  1. 365
Platform
  1. Windows
I am looking to find out why my code is behaving in this way. I put an X character in one of several cells depending on a condition.
The line to output this is:
Code:
Sheets("Sheetname").range("C3") = "X"

If I put a breakpoint at this line, then hit F5 to continue, no value appears. However, if at the breakpoint I use F8 to step into one line, the X appears
as expected. Then if I F5 to continue the X remains.

I've verified that screen updating is on. Any help in where to look to solve this would be appreciated, it just makes no sense to me right now.

Thanks
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I haven't heard of different results from using F8 versus F5 to execute code.

There are possible reasons why that statement could give you inconsistent results if you don't have the same workbook active each time. Perhaps that was the cause and it happened to coincide with your trying F8 vs F5?

If you'd like additional help, please post your entire code.
 
Upvote 0
Thanks for the suggestion. It was the same workbook. I'm not able to post my entire code; I found a workaround and this will just remain a mystery I guess.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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