+ Reply to Thread
Results 1 to 4 of 4

Find and Replace

Hybrid View

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    48

    Find and Replace

    2 Tables in 2 different sheets.
    Sheet1:
    Table 1:
    Name Gender
    John Male
    Richard Male
    Clara Female
    Sheet2:
    Table 2:
    University Grad Name
    XYZ MS John
    XYZ MS George
    XYZ MS Clara
    XYZ MS John
    XYZ MS John
    XYZ MS Clara

    I need the table 2 to be changed to the following through macro:
    University Grad Name
    XYZ MS Male
    XYZ MS Male
    XYZ MS Female
    XYZ MS Male
    XYZ MS Male
    XYZ MS Female

    Any help would be highly appreciated.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find and Replace

    Maybe:

    Sub saidineshbabu()
    Dim i As Long, x As Long
    Dim ws As Worksheet, ws2 As Worksheet
    Set ws = Sheets("Sheet1")
    Set ws2 = Sheets("Sheet2")
    x = ws.Range("A" & Rows.Count).End(3).Row
    With ws2
        For i = 2 To x
            .Columns(3).Replace ws.Range("A" & i).Value, ws.Range("B" & i).Value
        Next i
    End With
    End Sub

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    chennai
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Find and Replace

    Cool thanks. This worked.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Find and Replace

    You're welcome. Glad to help out and thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  2. Replies: 3
    Last Post: 11-25-2014, 06:08 AM
  3. [SOLVED] find and replace to not replace characters found as wildcards
    By sabutler4 in forum Excel General
    Replies: 4
    Last Post: 07-03-2013, 06:48 PM
  4. find in excel replace in word: find/replace text in text boxes and headers
    By dean.rogers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2012, 12:40 PM
  5. find and replace - replace data in rows to separated by commas
    By msdker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-14-2006, 08:10 PM

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