frustrated with VBA select/activate and screen flips

W

William DeLeo

I'd like to execute a series of commands without pulling the variou
screens worked on to the front. The user needs to see no screen flip
to the sheets referenced.

I believe I need to replace all my "activesheet." and "selection.
commands with specific sheet references ... but all I get is error
when I try. There must be some rhyme or reason, but I am not seein
it. Guidance please.

TIA
WD

********************************************

The following blocks of code need to be modified:

1)
Worksheets("Usage Log").Activate
With ActiveSheet.AutoFilter.Range

2)
Sheets("Usage Log").Select
Selection.AutoFilter Field:=2, Criteria1:=date_selection

3)
Worksheets("Usage Log").Activate
ActiveSheet.Cells.Select
Selection.AutoFilter

4)
Sheets("Usage Log").Select
Range("AH6:AX35").Select
Selection.ClearContent
 
B

Bob Phillips

"William DeLeo" <[email protected]>
wrote in message
I'd like to execute a series of commands without pulling the various
screens worked on to the front. The user needs to see no screen flips
to the sheets referenced.

I believe I need to replace all my "activesheet." and "selection."
commands with specific sheet references ... but all I get is errors
when I try. There must be some rhyme or reason, but I am not seeing
it. Guidance please.

TIA
WD

********************************************

The following blocks of code need to be modified:

1)
Worksheets("Usage Log").Activate
With ActiveSheet.AutoFilter.Range


With Worksheets("Usage Log").AutoFilter.Range

2)
Sheets("Usage Log").Select
Selection.AutoFilter Field:=2, Criteria1:=date_selection


Sheets("Usage Log").AutoFilter Field:=2, Criteria1:=date_selection

3)
Worksheets("Usage Log").Activate
ActiveSheet.Cells.Select
Selection.AutoFilter


Worksheets("Usage Log").Cells.AutoFilter

4)
Sheets("Usage Log").Select
Range("AH6:AX35").Select
Selection.ClearContents


Sheets("Usage Log").Range("AH6:AX35").ClearContents
 
D

Don Guillett

Selections are rarely necessary or desirable. Had you recorded a macro while
doing manually you could then clean up to look something like this

1 & 2 & 3 NO selections
Worksheets("Usage Log").range("???"). _
AutoFilter Field:=2, Criteria1:=date_selection

4)'NO selections
Sheets("Usage Log").range("AH6:AX35").ClearContents

You can stop the "screen flips" by
application.screenupdating=false
your code here
application.screenupdating=true


--
Don Guillett
SalesAid Software
[email protected]
"William DeLeo" <[email protected]>
wrote in message
news:[email protected]...
 
W

William DeLeo

Thank you both so very much ... I posted the question, went to lunc
though I didn't plan to, had two (yes two) wonderful martinis t
relieve my stress with the hope that some kind soul would have offere
a solution by the time I got back ... and there it is, times two.

You guys rock! I will use the screen update thing for this applicatio
but log the other for future reference.

Again, thank you both so much! I need to give back to this forum ...
some times answer easy ones, but I am still very much indebted
 
W

William DeLeo

noted for future reference :)


(thanks again guys ... things are moving along nicely for me now
 
Top