Results 1 to 11 of 11

Thread: Find/Replace in Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,888
    Location
    Rows 52081 and 52083 in the Big Sample.xlsx have a #NAME error in column B so that was the Type Mismatch error

    Maybe this - only took 3-4 seconds on the large file

    Option Explicit
    Sub Change_Text()
        
        Dim rCell As Range
        
        Application.ScreenUpdating = False
         
        For Each rCell In Worksheets("Sheet1").UsedRange.Cells
            If VarType(rCell.Value) <> vbString Then GoTo GetNextCell
            If LCase(Trim(rCell.Value)) <> "english section details" Then GoTo GetNextCell
            If LCase(Trim(rCell.Offset(1, 0).Value)) <> "term" Then GoTo GetNextCell
            
            rCell.Offset(1, 0) = "English Terms"
            'rCell.Offset(1, 0).Interior.Color = vbRed     <<<< just for testing
    GetNextCell:
        Next
         
        Application.ScreenUpdating = True
    End Sub
    Last edited by Paul_Hossler; 02-24-2017 at 09:19 PM.
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

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