![]() |
2 validation macros
Hi,
I have two different cells with different validation results. I would a macro to run for each of them depending on my scenario. It works for cell A14, but does not work for A16. Why? What is wrong with this picture? Private Sub Worksheet_Change(ByVal Target As Range) Application.ScreenUpdating = False If Target.Address = "$A$14" Then Application.EnableEvents = False Call selectedmacro_click Application.EnableEvents = True End If Application.ScreenUpdating = True End Sub Private Sub selectedmacro_click() Range("A:IV").EntireColumn.Hidden = False For Each c In Range("B1:IV1") If c < 1 Then Columns(c.Column).Hidden = True Next c Range("A10").Select End Sub Private Sub Target() Range("A:IV").EntireColumn.Hidden = False For Each c In Range("B1:IV1") If c < 1 Then Columns(c.Column).Hidden = True Next c Range("A10").Select End Sub Private Sub Worksheet1_Change(ByVal Period As Range) Application.ScreenUpdating = False If Period.Address = "$A$16" Then Application.EnableEvents = False Call selectedmacro1_click Application.EnableEvents = True End If Application.ScreenUpdating = True End Sub Private Sub selectedmacro1_click() Range("A:IV").EntireColumn.Hidden = False For Each c In Range("B5:IV5") If c < 1 Then Columns(c.Column).Hidden = True Next c Range("A10").Select End Sub Private Sub Period() Range("A:IV").EntireColumn.Hidden = False For Each c In Range("B5:IV5") If c < 1 Then Columns(c.Column).Hidden = True Next c Range("A10").Select End Sub |
All times are GMT +1. The time now is 01:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com