Supressing worksheet jumping

mr_pivot

New Member
Joined
Sep 2, 2009
Messages
6
I have created a macro to go to 5 worksheets and update filters on each sheet. I did this via recording mouse clicks. As I expected, when I run the macro it jumps to each worksheet and back to a cell on my starting worksheet.

Is there a way to set this up to updated the filters without having to jump to each worksheet? Can I suppress the worksheets from being displayed and update the filters without actually seeing this on screen?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,651
Hello and welcome to MrExcel.

Try adding this line near the top of your macro

Code:
Application.ScreenUpdating = False
and set it to True before the End Sub statement.

Or post your recorded code and it can probably be cleaned up to avoid selecting sheets at all.
 

mooseman

Board Regular
Joined
Jul 23, 2004
Messages
195
Put this at the beggining of your code
Application.ScreenUpdating = False
and this at the end
Application.ScreenUpdating = True
 

mooseman

Board Regular
Joined
Jul 23, 2004
Messages
195
VoG, you are like Speedy Gonzalez... the fastest answers in all Mr.Excel.....
 

mr_pivot

New Member
Joined
Sep 2, 2009
Messages
6
Holy cow!

You are fast and that did the trick. I have other places to use it as well!

MP
 

mr_pivot

New Member
Joined
Sep 2, 2009
Messages
6
Thanks.

I use them to make up for my lack of knowledge in VBA. It helps to learn code once I have done it thru mouse clicks.
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,651
Nothing wrong with recording macros at all. I still use the recorder when I can't remember the syntax for commands that I rarely use (like manipulating charts). But the recorder does a lot of selecting which is unnecessary and slows the code down.
 

Forum statistics

Threads
1,081,530
Messages
5,359,347
Members
400,524
Latest member
Excelbat

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top