Worksheet change event

Mongy

Board Regular
Joined
Dec 9, 2002
Messages
64
Office Version
  1. 365
Platform
  1. Windows
I have a basic worksheet change event, where on the one worksheet, cell changes values (case is), rows are hidden, or unhidden.

I'm not fluent/skilled enough, is there a way that when there is a change to a value in a cell in sheet1 (let's say "Show me" and "Where did it go"), that it triggers rows (10:15) to be hidden/unhiiden in sheet2?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
So try this if you will be entering Show me Or Where did it go in Range("A1") of Sheet(1)

If not modify code to your needs

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the Sheet(1) tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
Code:
[LEFT][COLOR=#222222][FONT=Tahoma]Private Sub Worksheet_Change(ByVal Target As Range)[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]'Modified  3/6/2019  9:53:03 AM  EST[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]If Target.Address = "$A$1" Then[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]    If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]If Target.Value = "Show me" Then Sheets(2).Rows("10:15").Hidden = True[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]If Target.Value = "Where did it go" Then Sheets(2).Rows("10:15").Hidden = False[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]End If[/FONT][/COLOR]
[COLOR=#222222][FONT=Tahoma]End Sub[/FONT][/COLOR][/LEFT]
 
Last edited:
Upvote 0
Thank you. Enough information in there to get me thru :)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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
Back
Top