+ Reply to Thread
Results 1 to 7 of 7

Macro to remove first character "K" from column of numbers

  1. #1
    Registered User
    Join Date
    06-06-2017
    Location
    CHICAGO
    MS-Off Ver
    2016
    Posts
    7

    Macro to remove first character "K" from column of numbers

    Hi,

    I need help creating a Macro that will remove the first character of a column on numbers when I copy and paste them to the next column. I need something that will ignore all others numbers without the letter "k" in front of them and only focus on the K numbers.
    For example:

    B123462
    K123462 123462
    K125100 125100
    A125100
    K129290 129290
    C129291
    K129292 129292
    Y133707

    Your help would be greatly appreciated

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Macro to remove first character "K" from column of numbers

    Data in column A, output in Column B
    Please Login or Register  to view this content.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Macro to remove first character "K" from column of numbers

    or use a formula in B column:

    =IF(ISNUMBER(SEARCH("K",A1)),SUBSTITUTE(A1,"K",""),"")

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Macro to remove first character "K" from column of numbers

    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Or
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1
    2 B123462
    3 K123462 123462
    4 K125100 125100
    5 A125100*
    6 K129290 129290
    7 C129291
    8 K129292 129292
    9 Y133707
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Macro to remove first character "K" from column of numbers

    .
    And one other method :

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-06-2017
    Location
    CHICAGO
    MS-Off Ver
    2016
    Posts
    7

    Re: Macro to remove first character "K" from column of numbers

    Thank you!
    My information is in column B starting in row 2 all the way down until the last number and I need the new data to go into column C starting row 2 all the way down till the last number. The program should stop after the last number as some data sets are large, while others are small. How can I modify this code to account for that?

  7. #7
    Registered User
    Join Date
    06-06-2017
    Location
    CHICAGO
    MS-Off Ver
    2016
    Posts
    7

    Re: Macro to remove first character "K" from column of numbers

    Thanks! The formula worked

+ 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. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  2. Replies: 1
    Last Post: 08-10-2014, 01:22 PM
  3. Replies: 5
    Last Post: 02-26-2014, 11:25 PM
  4. remove all text after and including the last ":" character in column c
    By smith310 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2013, 09:36 AM
  5. [SOLVED] remove all characters to right of "-" character, including "-"
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-27-2012, 02:43 PM
  6. Remove space and "-" character
    By thanhnguyen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2006, 11:50 PM
  7. Replies: 3
    Last Post: 01-18-2006, 01:10 PM

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