+ Reply to Thread
Results 1 to 9 of 9

[SOLVED] hide rows with macro

  1. #1
    Alen32
    Guest

    [SOLVED] hide rows with macro

    I want makro which can find out which cells are empty in area a12:a35 and
    hide those rows where cells are empty.


  2. #2
    bigwheel
    Guest

    RE: hide rows with macro

    "Alen32" wrote:

    > I want makro which can find out which cells are empty in area a12:a35 and
    > hide those rows where cells are empty.
    >
    >


    One way:-

    Sub HideRows()
    For a = 12 To 35
    If Cells(a, 1) = "" Then
    Cells(a, 1).Select
    Selection.EntireRow.Hidden = True
    End If
    Next a
    End Sub

  3. #3
    Alen32
    Guest

    RE: hide rows with macro

    doesn't work.


  4. #4
    bigwheel
    Guest

    RE: hide rows with macro

    "Alen32" wrote:

    > doesn't work.
    >
    >

    Should do. I trust you copied the lines into a new module
    ( Alt+F11>Insert>Module )

  5. #5
    Alen32
    Guest

    RE: hide rows with macro

    it works in some sheets but dosn't work in some others sheets. I don't know
    why


  6. #6
    bigwheel
    Guest

    RE: hide rows with macro

    Depends on whether the cells are empty or contain a space, I guess

  7. #7
    Alen32
    Guest

    RE: hide rows with macro

    how to remove space?


  8. #8
    Tom Ogilvy
    Guest

    Re: hide rows with macro

    Sub HideRows()
    Dim cell as String
    Dim a as Long
    For a = 12 To 35
    cell = Application.Substitute(Cells(a,1).Text,chr(160),"")
    If Trim(cell) = "" Then
    Cells(a, 1).EntireRow.Hidden = True
    End If
    Next a
    End Sub


    --
    Regards,
    Tom Ogilvy

    "Alen32" <[email protected]> wrote in message
    news:[email protected]...
    > how to remove space?
    >




  9. #9
    Alen32
    Guest

    Re: hide rows with macro

    thanks!


+ 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