Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using "ScreenUpdating"

Posted on 2016-10-12
6
Medium Priority
?
103 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 1200 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 1200 total points
ID: 41840435
Or

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

Assisted Solution

by:Martin Liss
Martin Liss earned 400 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 22

Assisted Solution

by:Roy Cox
Roy Cox earned 400 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 22

Expert Comment

by:Roy Cox
ID: 41841367
Pleased to help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

719 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