+ Reply to Thread
Results 1 to 6 of 6

Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

  1. #1
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Question Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

    Is it possible to create a macro that will take a column with each row only having numbers 1-4 and replacing each number in a row with a specific letter??

    i.e.

    1=A
    2=C
    3=G
    4=T

    Attached is a sample sheet that this would be done to...
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

    hi, goldbeje, can you post the expected result for your data provided?

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

    goldbeje,

    Give this a try. Change the columns() letter as necessary
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    10-25-2011
    Location
    Des Moines, Iowa
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

    @Waterserv the attached below is the expected results.

    @Tigeravatar ... can I change the Columns ("C") to ("C","D") to reflect the change to both columns at once??

    Thank you both for your help with this... I know this question is probably very novice.
    Attached Files Attached Files
    Last edited by goldbeje; 10-26-2011 at 09:11 PM.

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

    goldbeje,

    Yes, you can change the Columns() line. It would look like:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Creating a Marco to Replace a Specific Number with a Specific Letter in a Column

    It could be wise to use:

    Please Login or Register  to view this content.



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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