help needed with excel macro coding in vb

Discussion in 'OT Technology' started by BimmerJustin, Mar 25, 2009.

  1. BimmerJustin

    BimmerJustin Why would you deny yourself something you want?

    Joined:
    Dec 31, 2000
    Messages:
    57,527
    Likes Received:
    8
    Location:
    Fantasyland
    Trying to set up a macro that adds the letters "EA" to a long list of codes.

    After recording it manually, it wanted the individual numbers, in quotes, in the code, which would eliminate the whole point of the macro:

    ActiveCell.FormulaR1C1 = "5D0368EA"
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "5D03689EA"
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "5D03689EB"
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "5D03689EC"
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "5D03689ED"


    but I want it to do something to the affect of

    for i = 1 to 100000
    ActiveCell.FormulaR1C1 = A1 "EA"
    offset (1,0)
    next i

    How would I code that?
     
  2. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    It would be easier to simply add another column and just use a forumula:

    =A1&"EA"

    Drag that down the rest of the rows in the column
     
  3. jvblackxj

    jvblackxj VW4Life

    Joined:
    Mar 14, 2003
    Messages:
    100
    Likes Received:
    0
    Excel has a function to do that already it is concatenate.

    Example =CONCATENATE(A1,"EA")
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Or, what I said.
     

Share This Page