+ Reply to Thread
Results 1 to 4 of 4

generalies

  1. #1
    Registered User
    Join Date
    03-05-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    42

    generalies

    find the word and highlighst vba extention below code is for one word monkey
    in this only i want to search more words how?
    Sub example()

    Dim iLoop As Integer
    Dim i As Integer
    Dim rNa As Range

    ' count number of monkeys in Activesheet (change to sheet required)
    iLoop = WorksheetFunction.CountIf(ActiveSheet.UsedRange, "*" & "monkey" & "*")

    ' loop through and find monkeys
    Set rNa = ActiveSheet.Range("A1") ' change sheet if necessary
    For i = 1 To iLoop
    Set rNa = Cells.Find(What:="monkey", After:=rNa, _
    LookIn:=xlValues, LookAt:=xlPart, _
    SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False)
    ' highlight the rows
    rNa.EntireRow.Interior.ColorIndex = 36
    Next i

    End Sub

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: generalies

    Please take a moment to read the forum rules, amend your thread title and add code tags to your post.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: generalies

    Cross poster http://www.msofficeforums.com/excel/...extention.html
    http://www.mrexcel.com/forum/showthr...17#post3081317
    Last edited by Pepe Le Mokko; 03-15-2012 at 10:39 AM.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: generalies

    Jeez!!!

    @gsrikanth - When you've finished with the forum rules (including the bit about cross posting) take a reed of this: http://www.excelguru.ca/content.php?184

    Dom

+ 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