+ Reply to Thread
Results 1 to 3 of 3

Thread: Rectification of code

  1. #1
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    168

    Rectification of code

    Hi,
    I am trying to write this code but getting all sort of error. Can somebody please help me to rectify the code.
    All I want is if I click the chekbox the below row from 19 to 24 will become visible else invisible.

    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Me.chkbox1.Value = True Then
        'If Range("e18").Value = 1 Then
        Rows("19:24").EntireRow.Hidden = True
        Else
        Rows("19:24").EntireRow.Hidden = False
        End If
    End Sub
    thnks in advance.
    Last edited by fatalcore; 01-10-2012 at 12:22 PM.

  2. #2
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,352

    Re: Rectification of code

    fatalcore,

    Give this a try:
    Private Sub Worksheet_Change(ByVal Target As Range)
        
        If Target.Address = "$E$18" Then
            If Target.Value = 1 Then
                Me.Rows("19:24").Hidden = True
            Else
                Me.Rows("19:24").Hidden = False
            End If
        End If
        
    End Sub
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    168

    Re: Rectification of code

    Thanks Tigeravatar.Solved.
    Last edited by fatalcore; 01-10-2012 at 12:21 PM.

+ 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.2.0