+ Reply to Thread
Results 1 to 5 of 5

VBA to insert text based on cell in range

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    VBA to insert text based on cell in range

    I am looking code to insert text into a column based on the value in a specified range, Currently I am using the following vlookup code =VLOOKUP(N3,$AM$2:$AN$8,2,0) but have been finding it very slow when using a macro for the rest of the workbook, I have attached a copy of the workbook showing the code and what I am trying to achieve.
    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA to insert text based on cell in range

    Try this formula instead:-

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA to insert text based on cell in range

    Hi Burt,

    This works for just the one contact as per your sample:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: VBA to insert text based on cell in range

    xladept, thanks that works great for the one as per the example but is it possible to make it work for all 5 possible contacts in columns N, P, R, T, V.
    Thanks and sorry for not being clear.
    Johnny

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA to insert text based on cell in range

    Hi Johnny,

    Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 04-11-2016 at 11:06 AM.

+ 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. Macro to insert text into a cell based on another cell's number
    By ahovancsak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-15-2015, 12:47 PM
  2. Replies: 6
    Last Post: 04-15-2015, 10:25 PM
  3. lock and insert formula in a cell based on selection of text in another cell
    By alirazafazal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2014, 06:08 AM
  4. [SOLVED] Insert range of cells based on cell critera
    By joyhampton in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-08-2014, 11:34 AM
  5. Formula to identify part of a text in cell from range of cells & insert adjacent cell text
    By Novicebutnotforlong in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-19-2013, 02:11 AM
  6. [SOLVED] Event Macro to insert text in cell based on input of another cell
    By nplouffe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2012, 11:54 AM
  7. Insert row with certain text based on value in a cell in Column A
    By bholabhala in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2011, 05:06 AM

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