Spreadsheet screen flickers for a few second when using a condition

  • Thread starter Thread starter wayne
  • Start date Start date
W

wayne

Hi

When I use the following script in Microsoft Excel to automatically
update a figure based on a yes/no condition in cell c20 the screen
flickers. The value and program does work but it is very pleasant to
watch. Can anyone help?


Wayne


Private Sub Worksheet_Calculate()
Sheets("Work Order Request").Select

If Range("c20").Value = "yes" Then
Range("g20").Value = "=c18"
Else
Range("g20").Value = "Enter CBA Number"
End If
' Range("g20").Value = "=c18"
End Sub
 
Instead of setting screenupdating to false, avoid selecting the sheet:

Private Sub Worksheet_Calculate()
With Sheets("Work Order Request")
If .Range("c20").Value = "yes" Then
.Range("g20").Value = "=c18"
Else
.Range("g20").Value = "Enter CBA Number"
End If
End With
End Sub

If work order request is already the active sheet and
it is the updating of the cell that bothers you, then perhaps look away.
 
If the activating of the sheet is removed, the flicker seems worse with
application.ScreenUpdating being turned off and on.
 
Tom Ogilvy said:
If work order request is already the active sheet and
it is the updating of the cell that bothers you, then perhaps look away.

Very amusing :-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top