Results 1 to 9 of 9

Hiding/Unhiding cells using vba

Threaded View

rmahal1 Hiding/Unhiding cells using... 06-30-2008, 05:03 AM
royUK Welcome to the Forum, please... 06-30-2008, 05:16 AM
royUK Try something like this ... 06-30-2008, 05:31 AM
rmahal1 Thanks for your reply. Have... 06-30-2008, 06:00 AM
royUK I can't test this because i... 06-30-2008, 06:19 AM
  1. #1
    Registered User
    Join Date
    06-30-2008
    Location
    birmingham
    Posts
    4

    Hiding/Unhiding cells using vba

    Hi All,

    Can anyone advise, I have not really done a lot of programming in excel. I have an excel sheet which is used a take off list for a mchine which as a number of variations.
    My first problem which i managed to solve was turning off a particular set cells if the machine size was any size other than 1750.
    My next problem is I want to create another one which will turn off cells if the value in a another cell says yes or no. Can anyone Advise.

    Vba Script so far:
    Private Sub Worksheet_Change(ByVal Target As Range)
    
       If Target.Cells.Count = 1 And Target.Address = "$B$7" Then
    
          If LCase(Target.Value) = "800" Then
    
             Rows("87:93").EntireRow.Hidden = True
    
          ElseIf LCase(Target.Value) = "1000" Then
    
             Rows("87:93").EntireRow.Hidden = True
        
          ElseIf LCase(Target.Value) = "1200" Then
    
             Rows("87:93").EntireRow.Hidden = True
    
          ElseIf LCase(Target.Value) = "1500" Then
    
             Rows("87:93").EntireRow.Hidden = True
                
          Else
    
             Rows("87:93").EntireRow.Hidden = False
          End If
    
          
    
       End If
    
       
    
    End Sub
    
    Private Sub Worksheet_Change1(ByVal Target As Range)
    
       If Target.Cells.Count = 1 And 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
    
          
    
       End If
    
       
    
    End Sub
    Last edited by royUK; 06-30-2008 at 05:17 AM.

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