Screen refresh

fireslguk

Active Member
Joined
Nov 11, 2005
Messages
291
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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,890
Office Version
  1. 365
Platform
  1. Windows
Try inserting this line after the cell value change line:
Code:
DoEvents
 

shaowu459

Well-known Member
Joined
Apr 26, 2018
Messages
570
Office Version
  1. 365
Platform
  1. Windows
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:

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,890
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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..
 

fireslguk

Active Member
Joined
Nov 11, 2005
Messages
291
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
 

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,890
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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
 

fireslguk

Active Member
Joined
Nov 11, 2005
Messages
291
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
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,387
Office Version
  1. 2016
Platform
  1. Windows
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 ?
 

Forum statistics

Threads
1,148,108
Messages
5,744,876
Members
423,907
Latest member
zerocool88

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
Top