Results 1 to 5 of 5

Hide rows up to item found

Threaded View

itcheg Hide rows up to item found 05-28-2009, 01:43 PM
GuruWannaB Re: Hide rows up to item found 05-28-2009, 03:00 PM
itcheg Re: Hide rows up to item found 05-28-2009, 03:35 PM
shg Re: Hide rows up to item found 05-28-2009, 05:38 PM
itcheg Re: Hide rows up to item found 06-01-2009, 04:52 PM
  1. #3
    Registered User
    Join Date
    05-28-2009
    Location
    Miami
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Hide rows up to item found

    Company and above (which can be found somewhere a1:100)

    e.g. if "company" is on row 30 than I want to hide rows 1 through (and including) 30

    My first try at vba... but this it what I was trying:

    Sub Hiderows()
        Dim lastRow As Integer
        
        Set lastRow = Cells.Find(What:="Company:", After:=ActiveCell, LookIn:=xlFormulas, _
            LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
            MatchCase:=False)
    
    Rows("A1" & ":" & lastRow).EntireRow.Hidden = True
    End Sub
    But this doesn't work as I'm doing something wrong
    Last edited by itcheg; 05-28-2009 at 06:39 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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