+ Reply to Thread
Results 1 to 10 of 10

Need a macro to find and replace plus change format of another colum

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    Tulsa
    MS-Off Ver
    Excel 2010
    Posts
    15

    Need a macro to find and replace plus change format of another colum

    I am sure there is a way to do what I need, I am just not smart enough to figure it out. Currently I produce a check file from an external data source. It is a delimited file. For whatever reason when the check file is produced the information in colum A should contain an "I" for issued but has a capitol "L" instead. The first thing I do is a Control-H after highlighting column A and say to find anything with an "L" and replace with a "I". Next I go to Column F and highlight the cell contents which could be 70 or 100 entires. This is a date field but drops the leading zero. I format the cells with a custom input (right click and select format cells) select custom and by putting eight zeros in the type field. The data in the cell stays in tacked and the leading zero is put back in. I then upload the spreedshet to the bank for processing. The reason I have to do this is the banks software will kick it back with invalid entries which cost me 75 cents for each bad entry if I don't go through this process.

    Idealy I would like to have a macro that can check column A and if there is data present put an "I" in the cell. After that happens I need the macro to check column F and put a leading "0" in front of any data in that column/cells. Keep in mind that this check file could have 10 entries or 100 entries so I only need it to put data in a cell if data is present. Otherwise it will fill the column/cells with entries that have no data and would be I guess 8000 entries which without the proper data would result in errors and a 75 cent fine to me.

    I hope someone can help me. Would be a nice macro for such a repetive task. This happens several times a day.

    Thanks....Steve

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Need a macro to find and replace plus change format of another colum

    Have any sample data?
    Click on star (*) below if this helps

  3. #3
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Need a macro to find and replace plus change format of another colum

    Have tried using the macro recorder to carry these items out ?

  4. #4
    Registered User
    Join Date
    01-29-2013
    Location
    Tulsa
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need a macro to find and replace plus change format of another colum

    sample.xlsx

    Here is a sample of the data....

  5. #5
    Registered User
    Join Date
    01-29-2013
    Location
    Tulsa
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need a macro to find and replace plus change format of another colum

    If I use the recorder with my manual steps it covers the cells/rows that are present on that run. The rows change number of entries on each run.

  6. #6
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Need a macro to find and replace plus change format of another colum

    Try this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-29-2013
    Location
    Tulsa
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need a macro to find and replace plus change format of another colum

    K m, I know this is going to be a dumb question but I am new to macros. How would I run the script you posted or assigned to my excel. Sorry I know it is probably easy for others but I kind of need a little help.

  8. #8
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Need a macro to find and replace plus change format of another colum

    The easiest way is using the macro recorder.

    However, to answer your question.
    - Copy the text above

    - Click on the Developer Tab. If you don't see the Developer Tab do this:
    - To get the Developer tab to display in Excel 2010, click the Office Button > Excel > Options > Customize Ribbon
    or File/Excel/Options/Customize Ribbon.

    After you have the Developer Tab
    - Click on the Developer Tab, Click on Visual Basic/Insert/Module/
    - Now paste the text in the module

    - Now File/Close and Return to Excel

    You now have the macro loaded

    Run the macro using the Developer Tab

    If you do this often, you can give the macro a short cut key
    Last edited by K m; 01-29-2013 at 06:01 PM.

  9. #9
    Registered User
    Join Date
    01-29-2013
    Location
    Tulsa
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Need a macro to find and replace plus change format of another colum

    K,

    Awsome...yes it worked just like I needed it to. Thank you so much!

  10. #10
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Need a macro to find and replace plus change format of another colum

    Change the title as [SOLVED] and click on the star at the bottom of this message for positive feedback

+ 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