ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Spreadsheet screen flickers for a few second when using a condition (https://www.excelbanter.com/excel-programming/321590-spreadsheet-screen-flickers-few-second-when-using-condition.html)

wayne

Spreadsheet screen flickers for a few second when using a condition
 
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

Don Guillett[_4_]

Spreadsheet screen flickers for a few second when using a condition
 
application.screenupdating=false
code
reset to true

--
Don Guillett
SalesAid Software

"wayne" wrote in message
om...
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




Tom Ogilvy

Spreadsheet screen flickers for a few second when using a condition
 
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.


--
Regards,
Tom Ogilvy



"wayne" wrote in message
om...
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




Tom Ogilvy

Spreadsheet screen flickers for a few second when using a condition
 
If the activating of the sheet is removed, the flicker seems worse with
application.ScreenUpdating being turned off and on.

--
Regards,
Tom Ogilvy

"Don Guillett" wrote in message
...
application.screenupdating=false
code
reset to true

--
Don Guillett
SalesAid Software

"wayne" wrote in message
om...
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






WayneL

Spreadsheet screen flickers for a few second when using a condition
 

Thanks


Works perfectly..


WayneL


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Bob Phillips[_6_]

Spreadsheet screen flickers for a few second when using a condition
 

"Tom Ogilvy" wrote in message
...

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 :-)




All times are GMT +1. The time now is 10:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com