+ Reply to Thread
Results 1 to 11 of 11

replace "X" with column A same row

  1. #1
    Registered User
    Join Date
    01-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    26

    replace "X" with column A same row

    Looking for a way to check if a cell contains "X" and if it does the replace it with the data from the cell in the same row column A. Ive searched the web and tested a few ways but nothing quite fits what im looking to do.

    thanks in advance

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: replace "X" with column A same row

    Change the references and Offset to suit


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: replace "X" with column A same row

    copy and pasted into a macro but i cant get it to change anything when i run it. The cells where X's will be placed randomly are e6:EH79. As each "X" is found it needs to copy the value of columnA from the same row into that cell.

    thanks for your time

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: replace "X" with column A same row

    Try this on a copy of your workbook.
    Not the most efficient code but until someone comes around that knows what they're doing, this might just help you for now.


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: replace "X" with column A same row

    Thanks for the code. I copy and pasted this into the proper sheet and nothing happened. I also tried creating a macro of it and running it and still nothing happened. Not sure what im doing wrong here.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: replace "X" with column A same row

    It works for me on a test sheet.
    Are the X's in capitals or are they small x's?
    Do they have a space in front or behind?
    If any of the above, it won't work as it strictly looks for the X without spaces (front or back).

  7. #7
    Registered User
    Join Date
    01-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: replace "X" with column A same row

    They are small x's. Ill try making them big X's and see if that works. No spaces are in the cells. Ill be back with the results. Thank you again



    It works for me on a test sheet.
    Are the X's in capitals or are they small x's?
    Do they have a space in front or behind?
    If any of the above, it won't work as it strictly looks for the X without spaces (front or back).

  8. #8
    Registered User
    Join Date
    01-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: replace "X" with column A same row

    That was the problem. Works like a charm. Thank you so much.. all it took was for me to change the x's to capital ones.

    Quote Originally Posted by jolivanes View Post
    It works for me on a test sheet.
    Are the X's in capitals or are they small x's?
    Do they have a space in front or behind?
    If any of the above, it won't work as it strictly looks for the X without spaces (front or back).

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: replace "X" with column A same row

    Glad it worked.
    You could also change the X in the code to a small x if the entries in the sheet tend to be small x's.
    Or, if need be, you can change the code so it works on both X and x.

    Regards
    John

  10. #10
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: replace "X" with column A same row

    If you want the code to work with both Upper case and Lower case,change this line

    Please Login or Register  to view this content.

    to this


    Please Login or Register  to view this content.

    HTH

    John

  11. #11
    Registered User
    Join Date
    01-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: replace "X" with column A same row

    i ended up writing code to change all the x's to X's then I ran your code. again I appreciate your time and help.

+ 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