Solved

Modify code so that when designated cells contain an "X", the row below will be unhidden

Posted on 2011-02-20
3
311 Views
Last Modified: 2012-05-11
Code below works, but how can it be modified to accomodate "X" in the following cells and row immediately below is unhidden:  I15, I17, I20, J23, J25, J30 & J32?

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range

Set rng = Me.Cells(13, "I")

If Not Intersect(rng, Target) Is Nothing Then
    If UCase(Target.Value) = "X" Then
        Rows("9:11").EntireRow.Hidden = False
    End If
End If

End Sub
0
Comment
Question by:klitton7
3 Comments
 
LVL 41

Accepted Solution

by:
dlmille earned 500 total points
ID: 34947177
Just tested - this should work correctly for you:
 
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range

    Set rng = Range("I15,I17,I20,J23,J25,J30,J32") 'range to check for changes
    
    If Not Intersect(Target, rng) Is Nothing Then
        If UCase(Target.Value) = "X" Then
            Target.Offset(1, 0).EntireRow.Hidden = False 'unhide row immediately beneath where X was just typed
        End If
    End If

End Sub

Open in new window


Enjoy!

Dvae
0
 

Author Closing Comment

by:klitton7
ID: 34947206
Thank you very much!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Moving Excel to AaaS 4 36
Excel Score Formula 5 47
Boolean help 6 27
From msAccess  SaveAs an excel file SILENTLY without opening excel 4 29
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now