Solved

Using "ScreenUpdating"

Posted on 2016-10-12
6
83 Views
Last Modified: 2016-10-12
EE Pros,

I have a simple macro that when fired, causes a flicker as it runs.  I've tried to use the "Application.Screenupdating = False, but either have it in the wrong place or am not using the correct line of code.  Any help would be appreciated.

Sub RestoreValueProps()

On Error Resume Next

 With ActiveSheet
    Application.ScreenUpdating = False

.Range("G12") = "=I150"
.Range("G14") = "=I151"
.Range("G16") = "=I152"
.Range("G18") = "=I153"
.Range("G20") = "=I154"
.Range("G22") = "=I155"
.Range("G24") = "=I156"
.Range("G26") = "=I157"

End With

End Sub

Open in new window


Thanks in advance,

B.

Edit:  Code placed in snippet with thanks and Initial removed to end
GrahamSkan
0
Comment
Question by:Bright01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 300 total points
ID: 41840428
Try this

Sub RestoreValueProps()
Application.ScreenUpdating = False

On Error Resume Next

 With ActiveSheet
   
.Range("G12") = "=I150"
.Range("G14") = "=I151"
.Range("G16") = "=I152"
.Range("G18") = "=I153"
.Range("G20") = "=I154"
.Range("G22") = "=I155"
.Range("G24") = "=I156"
.Range("G26") = "=I157"

End With
Application.ScreenUpdating = True

End Sub
0
 
LVL 15

Assisted Solution

by:Haris Djulic
Haris Djulic earned 300 total points
ID: 41840435
Or

Application.ScreenUpdating = False
Call restorevalueprops()
Application.ScreenUpdating = True
0
 
LVL 47

Assisted Solution

by:Martin Liss
Martin Liss earned 100 total points
ID: 41840556
Are you aware that Application.ScreenUpdating is always True when debugging? Anyhow, your macro as written will trigger the Worksheet_Change event. Do you have an Application.ScreenUpdating = True line there?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Assisted Solution

by:Roy_Cox
Roy_Cox earned 100 total points
ID: 41840568
There is nothing in your code that would cause a screen to flicker, although you should restore ScreenUpdating to True at the end of the code because it will not restore itself.

There must be something else that is causing the flicker, your code runs fine for me without switching off ScreenUpdating
0
 

Author Closing Comment

by:Bright01
ID: 41840626
Great work!
0
 
LVL 19

Expert Comment

by:Roy_Cox
ID: 41841367
Pleased to help
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question