Changes other sheets without jumping back and forth

Loin75

Active Member
Joined
Oct 21, 2009
Messages
281
I have set a rule that if a cell on sheet A gets changed, then rows on sheet B become hidden.

Is there a way to make this happen without having to select sheet B in the process - as the user ends up watching the macro jump to sheet B and back again.

I'd like it to happen discreetly / silently..

Many Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

JamesW

Well-known Member
Joined
Oct 30, 2009
Messages
1,197
Hi there,

Can you post your macro below? It's probably a simple 1 liner to add (Application.Screenupdating = False).
 

Loin75

Active Member
Joined
Oct 21, 2009
Messages
281
Never posted in tags before. Can you explain how please..

(sorry for ignorance)
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi

It would be easier if you had posted your existing code, but you don't need to Select a sheet to work with it - so in your Change event on the first sheet you can hide rows on the second without selecting it:

Code:
'for Sheet 1:
 
Private Sub Worksheet_Change(ByVal Target As Range)
 
If Target.Address = "$A$1" Then
  Sheets("Sheet2").Range("A3:A4").EntireRow.Hidden = True
End If
End Sub
 

Loin75

Active Member
Joined
Oct 21, 2009
Messages
281

ADVERTISEMENT

Utter genius... ---> (easily impressed)

Thanks Richard.

Would still like to know how to post code in tags. Is it this icon "wrap (quote)"??
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Yeah just wrap the code in tags like this [ code ] Your code here [ / code ]

Omit the spaces and the board will fit the code into the code box
 

Watch MrExcel Video

Forum statistics

Threads
1,130,445
Messages
5,642,194
Members
417,259
Latest member
gtacw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top