Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Leesburg, Virginia, USA
    Thanked 0 Times in 0 Posts

    Help with macro (Excel 2003)

    I have a list of airport identifiers that begining with the letter K. I would like to write a macro that would strip the fist K in every sting of letters. Most are 4 letter identifiers, eg. KDAL. I would like to have just DAL. If there are 2 Ks, I want to retain the second K, eg KKAN would become KAN. The identifiers are in Column A of a spreadsheet.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Help with macro (Excel 2003)

    You could use formulas in (for example) column B: =MID(A1,2,1000), then hide column A.
    In a macro:

    Sub ConvertCodes()
    Dim oCell As Range
    For Each oCell In Selection.Cells
    oCell = Mid(oCell, 2)
    Next oCell
    End Sub

    Select the range of cells before running the macro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts