I believe that if you examined ThisWorkbook.Worksheets("Admin").Range("H18").Value
after the line setting its value, its value would be exactly as expected.
While VBA that runs with Application.ScreenUpdating=True
generally shows on-screen whatever the code is doing, there is no requirement that Excel must update the screen.
Conversely, with Application.ScreenUpdating=False
, there is a requirement that Excel must not update the screen.
If for whatever reason Excel cannot command the system resources necessary to update the screen and do the other tasks it must perform while Application.ScreenUpdating=True
, screen updating will be temporarily turned off, leading to the issue you describe. DoEvents
may well fix this, but can lead to reduced performance, and other problems if you have events elsewhere in the workbook that are being triggered - DoEvents
is specifically saying "Handle pending events now".
You will get better performance if you use Application.ScreenUpdating=False
while your code is running, and use Application.StatusBar
to display status.