Results 1 to 3 of 3

Thread: Defining Ranges Using VBA

  1. #1

    Defining Ranges Using VBA

    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello Friends,

    I am new to to VB does have only vague idea about it..

    Private Sub CommandButton1_Click()
    Range(Range("a1").End(xlDown).Offset(1, 0), Range("a" & Rows.Count)).EntireRow.Hidden = True
    End Sub

    Private Sub CommandButton1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    Range(Range("a1"), Range("a" & Rows.Count)).EntireRow.Hidden = False
    End Sub

    I have a macro enabled book with a button to hide and unhide rows,but the
    problem with this code is it is hiding the entire blank "a" rows,i dont need like that just need to specify a range like A1:A50,i tried to change but it gives me a debug error..


  2. #2
    What is wrong with

    Rows("1:50").Hidden = True

  3. #3

Posting Permissions

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