LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default 'Application.ScreenUpdating = False' isn't working

This code just copies values from the active ws to another wb and then
pastes values from the wb back to the active ws. It works fine but I
want to hide the wb and stop the screen updating until the code is
complete... How can I do this?


Sub Populate_H6()
Dim ws As Worksheet
Dim wb As Workbook
Dim rng As Range
Dim rCell As Range

Application.ScreenUpdating = False

Set ws = ActiveSheet
Set wb = Workbooks.Open("A:\Lookup.xls")

With ws
Set rng = .Range(.Cells(1, 1), _
.Cells(.Rows.Count, 2).End(xlUp))
End With

For Each rCell In rng.Cells
Select Case rCell.Value
Case "TiM"
rCell.Offset(0, 1).Copy wb.Worksheets(13) _
.Range(rCell.Address).Offset(3, 1)
rCell.Offset(0, 2).Copy wb.Worksheets(13) _
.Range(rCell.Address).Offset(3, 2)
wb.Worksheets(13).Range(rCell.Address) _
.Offset(3, 5).Copy ws.Range(rCell.Address).Offset(0, 3)
Case "MiM"
rCell.Offset(0, 1).Copy wb.Worksheets(13) _
.Range(rCell.Address).Offset(3, 7)
rCell.Offset(0, 2).Copy wb.Worksheets(13) _
.Range(rCell.Address).Offset(3, 8)
wb.Worksheets(13).Range(rCell.Address) _
.Offset(3, 11).Copy ws.Range(rCell.Address).Offset(0, 3)
Case "WiM"
rCell.Offset(0, 1).Copy wb.Worksheets(13) _
.Range(rCell.Address).Offset(3, 13)
rCell.Offset(0, 2).Copy wb.Worksheets(13) _
.Range(rCell.Address).Offset(3, 14)
wb.Worksheets(13).Range(rCell.Address) _
.Offset(3, 17).Copy ws.Range(rCell.Address).Offset(0, 3)
End Select
Next

With ws
ws.Columns("D").ClearFormats
ws.Columns("D").AutoFit
End With

wb.Close savechanges:=False

Application.ScreenUpdating = True

End Sub


Thank You,
-- Dan

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set Application.ScreenUpdating = False for Gen use David_Williams_PG () Excel Discussion (Misc queries) 1 August 15th 06 12:06 PM
Using the Application.ScreenUpdating = False? Susan Hayes Excel Programming 1 January 29th 05 02:16 PM
Using the Application.ScreenUpdating = False? Susan Hayes Excel Programming 0 January 29th 05 03:50 AM
Application.screenUpdating = False Pamhall Excel Programming 1 December 17th 04 03:19 PM
Application.ScreenUpdating = False Pieter Kuyck Excel Programming 2 July 15th 03 06:28 PM


All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"