Help adding another criteria to this macro?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I want to add that column "A" must = "Active" for the column to not be hidden in this macro that works great.

any ideas how I can do this?

thanks

Tony

Heres my macro

Code:
Sub Hide_Contr()
Dim s As Range, c As Range
Date1 = ThisWorkbook.Sheets("Date").Range("B2").Value

LastRow3 = Sheets(Date1).Cells(Rows.Count, "A").End(xlUp).Row + 50
Set s = Range("I10", "I" & LastRow3)


For Each c In s
   If c.Value = "Tony" Or c.Value = "All" Then[COLOR=#ff0000] ''(Here I want it to say and Column A of that row = "Active" then)[/COLOR]
       c.EntireRow.Hidden = False
   Else
       c.EntireRow.Hidden = True
  End If
Next c
End Sub
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Maybe...

Code:
If c.Value = "Tony" Or c.Value = "All" And c.Offset(, -8) = "Active" Then
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

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