+ Reply to Thread
Results 1 to 9 of 9

Hiding/Unhiding cells using vba

Hybrid View

  1. #1
    Registered User
    Join Date
    06-30-2008
    Location
    birmingham
    Posts
    4
    Thanks for your reply. Have tried the code but does not do anything within my excel sheet.
    As for unhiding other cells. I want to use the takeoff sheet that will allow me to produce a takeoff list for variations of the machine. Once I get this section of the code to work i will also hope to add additoinal repeative lines of code for more varations based on a yes or no input. Thanks again.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I can't test this because i haven't got your workbook, you can attach it here.

    Are you sure that you have placed the code in the correct place?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-30-2008
    Location
    birmingham
    Posts
    4
    Hi Managed to get the first part of code to work still having troubled with the yes & no part of hte code to do anything. I have attached Workbook. Again Thanks for your help.
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Is this working how you want?

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Cells.Count > 1 Then Exit Sub
        If Target.Address = "$B$7" Then
            Select Case Target.Value
                Case 800
                    Rows("87:93").EntireRow.Hidden = True
                Case 1000
                    Rows("87:93").EntireRow.Hidden = True
                Case 1200
                    Rows("87:93").EntireRow.Hidden = True
                Case 1500
                    Rows("87:93").EntireRow.Hidden = True
                Case Else
                    Rows("87:93").EntireRow.Hidden = False
            End Select
        End If
        If Target.Address = "$B$10" Then
            If LCase(Target.Value) = "Yes" Then
                Rows("56:65").EntireRow.Hidden = True
            Else: Rows("56:65").EntireRow.Hidden = False
            End If
        Else: Exit Sub
        End If
    End Sub

  5. #5
    Registered User
    Join Date
    06-30-2008
    Location
    birmingham
    Posts
    4
    Thankyou, it works fine now.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1