+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 Macro - Search, then Replace

  1. #1
    Registered User
    Join Date
    11-04-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    Excel 2007 Macro - Search, then Replace

    Hello,

    i'm new to Excel and programming and i would like some help of you.

    I believe it's a simple help, however i was not able to figure out how to do this.

    What i need ?

    I have 2 sheets inside the same Worksheet, select a data on Sheet 2 and search the same value on Sheet 1, then i need to replace B,C & D from Sheet 2 to Sheet 1.

    I'm not sure if it's very clear, i will try to use an example :

    Sheet 1 (with old value)

    A - B - C - D (Columns)
    Invoice 001 - 250 - 311 - 423
    Invoice 002 - 111 - 222 - 333

    Sheet 2 (updated values)

    A - B - C - D
    Invoice 001 - 230 - 300 - 493
    Invoice 002 - 111 - 222 - 333

    So, i want to update the new value from Sheet 2 to Sheet 1, however i want to update only IF any change was mad

    In the example above, the Invoice 001 had some data updated and Invoice 002 kept the same data, i want this macro to update only Invoice 001 (that has updates).

    EDIT :

    http://uploading.com/files/a269b148/Book1.xlsx/

    Added a Sample workbook as request.
    Attached Files Attached Files
    Last edited by Azeon; 11-04-2011 at 10:57 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Macro - Search, then Replace

    Please attach a sample workbook so we can help you better.

  3. #3
    Registered User
    Join Date
    11-04-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel 2007 Macro - Search, then Replace

    Quote Originally Posted by arlu1201 View Post
    Please attach a sample workbook so we can help you better.
    I upload a file as an example.

    Thanks!

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Macro - Search, then Replace

    That link takes me to a site to download the file for a charge. Please attach the file on the forum itself.

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.

  5. #5
    Registered User
    Join Date
    11-04-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel 2007 Macro - Search, then Replace

    Quote Originally Posted by arlu1201 View Post
    That link takes me to a site to download the file for a charge. Please attach the file on the forum itself.

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Done,

    Sorry for the trouble.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Excel 2007 Macro - Search, then Replace

    Pl see attached file.It may help you.Views are welcome.
    With regards
    Attached Files Attached Files

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Excel 2007 Macro - Search, then Replace

    I was trying your code kv and found that i does the reverse. It updates sheet 2 with values from sheet 1.

  8. #8
    Registered User
    Join Date
    11-04-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel 2007 Macro - Search, then Replace

    Quote Originally Posted by arlu1201 View Post
    I was trying your code kv and found that i does the reverse. It updates sheet 2 with values from sheet 1.
    And also, if i add new data from Sheet 1, it will not update on Sheet 2.

    But Thanks for the help anyway Kv.

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Excel 2007 Macro - Search, then Replace

    Pl see attached file.It updates data from Sheet2 to Sheet1.
    Attached Files Attached Files

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2007 Macro - Search, then Replace

    Please don't clutter the Forum by quoting whole posts
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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