ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Two Worksheet Change macros in same worksheet? Is it possible? (https://www.excelbanter.com/excel-programming/395825-two-worksheet-change-macros-same-worksheet-possible.html)

Matt[_40_]

Two Worksheet Change macros in same worksheet? Is it possible?
 
It is possible to have two Worksheet changes macros for two different
cells names Input_SO and Input_SRT on the worksheet named
'Input' (Cells located in the same worksheet) even though they have
different names?

I have written the code for the cell called Input_SRT to do something
when that cell is changed.

When I write the code for a worksheet change for Input_SO, I start
having problems.
I am having trouble to hide rows 13:15 when Yes is selected for
Input_SO cell.
In the Input_SO, I have a dropdown list (using data validation) for
Yes or No to be selected.
If "Yes" is selected, I want the rows 13:15 on another worksheet
called 'Sand Hgt' to be hidden.

Any help is greatly appreciated. Thanks.

Matt


Bob Phillips

Two Worksheet Change macros in same worksheet? Is it possible?
 
You can't have tow but you handle it b y testing one after the other

If Not Intersect(Target, Me.Range(Input_SRT")) Is Nothing Then

'do the code already written
ElseIf Not Intersect(Target, Me.Range(Input_SO")) Is Nothing Then

If .Value = "Yes" Then

Worksheets("Sand Hgt").Rows("13:15").Hidden = True
End If
End If

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Matt" wrote in message
ups.com...
It is possible to have two Worksheet changes macros for two different
cells names Input_SO and Input_SRT on the worksheet named
'Input' (Cells located in the same worksheet) even though they have
different names?

I have written the code for the cell called Input_SRT to do something
when that cell is changed.

When I write the code for a worksheet change for Input_SO, I start
having problems.
I am having trouble to hide rows 13:15 when Yes is selected for
Input_SO cell.
In the Input_SO, I have a dropdown list (using data validation) for
Yes or No to be selected.
If "Yes" is selected, I want the rows 13:15 on another worksheet
called 'Sand Hgt' to be hidden.

Any help is greatly appreciated. Thanks.

Matt





All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com