Screen refresh

fireslguk

Active Member
Joined
Nov 11, 2005
Messages
305
Struggling to see screen refresh on gauges

Have vba code that on click of button waits 3 seconds then changes specific cell value then waits and again changes value

The actual cells change but the needle on gauge doesn’t move whilst code running it will change when code finishes to reflect final cell value

Thoughts anyone ?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Try inserting this line after the cell value change line:
Code:
DoEvents
 
Upvote 0
add following code under Sub() or Button1.clikc()

Code:
application.screenupdating=false

I misunderstand your question...please ignore my answer and refer to floor 2.
 
Last edited:
Upvote 0
Maybe force the sheet to recalculate after the value updates? Without your code, difficult to suggest anything more and not sure disabling the screen updating is what you're after..
 
Upvote 0
Sub RectangleBeveled9_Click()

Application.Wait (Now + TimeValue("0:00:04"))
Range("p6").Select
ActiveCell.FormulaR1C1 = ".2"
Application.Wait (Now + TimeValue("0:00:01"))
Range("p7").Select
ActiveCell.FormulaR1C1 = ".3"
Range("p8").Select
Application.Wait (Now + TimeValue("0:00:04"))
Range("p6").Select
ActiveCell.FormulaR1C1 = ".4"
Application.Wait (Now + TimeValue("0:00:01"))
Range("p7").Select
ActiveCell.FormulaR1C1 = ".6"
Range("p8").Select
Application.Wait (Now + TimeValue("0:00:04"))
Range("p6").Select
ActiveCell.FormulaR1C1 = ".7"
Application.Wait (Now + TimeValue("0:00:01"))
Range("p7").Select
ActiveCell.FormulaR1C1 = ".8"
Range("p8").Select

End Sub
 
Upvote 0
Try:
Code:
Sub RectangleBeveled9_Click()

Dim x as Long

Application.ScreenUpdating = True

For x = 6 to 8
  Application.Wait (Now + TimeValue("0:00:04"))
  Cells(x, 16).Value = 0.1 * (x-4)
  ActiveSheet.Calculate
Next x

For x = 6 to 8
  Application.Wait (Now + TimeValue("0:00:04"))
  Cells(x, 16).Value = 0.1 * x
  ActiveSheet.Calculate
Next x

End Sub
 
Upvote 0
Try:
Code:
Sub RectangleBeveled9_Click()

Dim x as Long

Application.ScreenUpdating = True

For x = 6 to 8
  Application.Wait (Now + TimeValue("0:00:04"))
  Cells(x, 16).Value = 0.1 * (x-4)
  ActiveSheet.Calculate
Next x

For x = 6 to 8
  Application.Wait (Now + TimeValue("0:00:04"))
  Cells(x, 16).Value = 0.1 * x
  ActiveSheet.Calculate
Next x

End Sub


Thanks for code but the needles still don’t move each step

Also a value being deposited in 8:16 using your code
 
Upvote 0
Thanks for code but the needles still don’t move each step

Also a value being deposited in 8:16 using your code

Is that a gauge chart you are using ? Can you upload a workbook example somewhere so we can take a look ?
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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