+ Reply to Thread
Results 1 to 5 of 5

replacing amounts of data in a worksheet.

  1. #1
    Registered User
    Join Date
    09-26-2008
    Location
    Latvia Riga
    Posts
    3

    replacing amounts of data in a worksheet.

    Hi guys, I need advice on how can I manage this:

    I have a workbook (WB1) with a list of numbers, let's say they are (for example):

    1;2;3;4;5;6

    And I have a list of changes, that states that I have to change the numbers in WB1 like that (for example):

    1 -> 2
    2 -> 3
    3 -> 7
    4 -> 6
    5 -> a
    6 -> e

    How can I do this using some kind of a macro, or a function, or something else besides the find and replace function, because there are 16 240 cells with numbers in my workbook, all different, and 12 345 have to be replaced, it will take me years doing this by hand. So, any advice?

    I have experience with formulas in excel, never wrote and used macros though.

    Thank you in advance for any help I can get.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    If all instances of those numbers have to be replaced, why can't you select the whole sheet and use Find & Replace?

    Rgds

  3. #3
    Registered User
    Join Date
    09-26-2008
    Location
    Latvia Riga
    Posts
    3
    Each figure that has to be replaced appears in the table one or two times. This gives a total of 6 000 original replacements. So if I use the find and replace function, I woud have to type in one figure at a time, and do this aprox. 6000 times, wich is a little boring, or maybe it is just me. =)

    Basicly what I am trying to find out, is there some kind of a method where I can apply a list of changes to a worksheet and let the technology do the rest?

    I have excel 2007 installed on my pc.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    How many unique numbers are you trying to replace, (no how many numbers need to be replaced)?

    If it's just a matter of half a dozen or so, then why can't you use the 'Replace All' button rather than just the 'Replace' button which your response above suggests you're using?

    If you record a macro that would be even better.

    If however there are more than a few unique numbers then you'll nee a looping macro to select the values from a table and do the replacing. In which case post back.

    Rgds

  5. #5
    Registered User
    Join Date
    09-26-2008
    Location
    Latvia Riga
    Posts
    3
    I need to replace a couple of thousand unique numbers. So If I use the replace all button, I still have to enter the values in the "Find" and "Replace with" fields a couple thousand times.

    It would be better if I could use something, where I can copy all of the before and after values to table , something like:

    Find what: a, b , c , d , e , f , g , ....
    Replace with: 1, 2, 3, 4, 5, 6, 7 , .....

    And apply this change list to a worksheet using some macro or a function.

    I understand the concept of the "Find and Replace" and the difference between the "Replace" and "Replace all" buttons =) and non of them suite my needs in the current project.

+ 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. Copying data worksheet to worksheet
    By fallito in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2008, 11:40 PM
  2. Extracting data from a large worksheet using 1 variable
    By Dano in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-06-2008, 12:50 AM
  3. Add sheet reference to data
    By Vlad999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2008, 11:31 PM
  4. Copy Data from another worksheet
    By Peter Wpg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-22-2008, 12:58 PM
  5. Help! Vba Copy Cell To Different Worksheet.
    By Dabooj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2006, 05:53 AM

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