MACRO: Hiding rows when blank and providing responses for other conditions

ChrisPadillaAZ

New Member
Joined
Nov 3, 2014
Messages
13
Office Version
  1. 365
Platform
  1. Windows
NameStatusEmailStatus2CommentsCarrierChk1
James SmithProvisionedJamesSmith@gmail.comREGISTEREDLukeVzW
Christopher AndersonDisabledChristopherAnderson@gmail.comPENDINGVzW
Ronald ClarkDisabledRonaldClark@gmail.comREGISTEREDVzW
Mary WrightProvisionedMaryWright@gmail.comPENDINGLeeVzW
Lisa MitchellDisabledLisaMitchell@gmail.comREGISTEREDATT
Michelle Johnson (VzW-ATT)DisabledMichelleJohnson@gmail.comPENDINGJamesATT
John ThomasProvisionedJohnThomas@gmail.comREGISTEREDJohnATT
Daniel RodriguezDisabledDanielRodriguez@gmail.comPENDINGATT
Laura Jackson (VzW-ATT)DisabledLauraJackson@hotmail.comREGISTEREDATT

Hi guys, I'm sure this is easy for you to wrap your heads around this, it's not the easiest for me. Any help you can provide would be amazing!!!!
Conditions
B = Provisioned and D= REGISTERED and Comments = (BLANK), Hide the row
B = DISABLED and D= TERMINATED and Comments = (BLANK), Hide the row
B = DISABLED and D= PENDING, G="DP Something wrong here"
A=Contains "VzW-ATT", B = DISABLED and D= REGISTERED, G="DR Something wrong here", and highlight that row in Yellow
B = DISABLED and D= Registered, G="DR Something wrong here"
B = Provisioned and D= PENDING, G="PP Something wrong here"
B = Provisioned and D= TERMINATED, G="PT Something wrong here"
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi @ChrisPadillaAZ , would you please update your Profile to include your OS(Platform) and Excel Version (Office Version) so that you can be provided with the solution that would be best for you?
 
Upvote 0
Try:
VBA Code:
Sub ProvideResponses()
    Application.ScreenUpdating = False
    Dim v As Variant, i As Long
    v = Range("A2", Range("A" & Rows.Count).End(xlUp)).Resize(, 6).Value
    For i = LBound(v) To UBound(v)
        If v(i, 2) = "Provisioned" And v(i, 4) = "REGISTERED" And v(i, 5) = "" Then
            Rows(i + 1).Hidden = True
        End If
        If v(i, 2) = "Disabled" And v(i, 4) = "TERMINATED" And v(i, 5) = "" Then
            Rows(i + 1).Hidden = True
        End If
        If v(i, 2) = "Disabled" And v(i, 4) = "PENDING" Then
            Range("G" & i + 1) = "DP Something wrong here"
        End If
        If v(i, 1) Like "*VzW-ATT*" And v(i, 2) = "Disabled" And v(i, 4) = "REGISTERED" Then
            Range("G" & i + 1) = "DR Something wrong here"
            Range("A" & i + 1).Resize(, 7).Interior.ColorIndex = 6
        End If
        If v(i, 2) = "Disabled" And v(i, 4) = "REGISTERED" Then
            Range("G" & i + 1) = "DR Something wrong here"
        End If
        If v(i, 2) = "Provisioned" And v(i, 4) = "PENDING" Then
            Range("G" & i + 1) = "PP Something wrong here"
        End If
        If v(i, 2) = "Provisioned" And v(i, 4) = "TERMINATED" Then
            Range("G" & i + 1) = "PT Something wrong here"
        End If
    Next i
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
Hi @ChrisPadillaAZ , would you please update your Profile to include your OS(Platform) and Excel Version (Office Version) so that you can be provided with the solution that would be best for you?
Where is the "Solved" button? X), maybe it was the little Check box, marking the code as the solution.. :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,143
Members
453,021
Latest member
Justyna P

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