Identify letters but not spaces

Discussion in 'Word VBA' started by eko1130@gmail.com, May 9, 2014.

  1. Guest

    Hi all,

    I have two tabs within an excel file, each with two columns. The first column in each tab has titles such as "A1" "A2", etc. that are the same betweenthe two tabs. The second column in each tab is for values corresponding toeach value.

    Im copying data from the second tab to the first tab. So I want to write a program that identifies the titles in the first tab, finds which ones in the second tab match to it, and then copy the corresponding value for that title from the second tab to the first tab--this is because the second tab, the source, has some extra titles and values that arent needed. I only need values for the titles in the first tab.

    Now i have that all done--im matching the titles. My only problem is if thetitle in one tab is "A1 " (note the space) and the second title is "A1", it wont identify them as the same.

    Is there a way to make it identify only the letters? Or one other thing I was thinking was if there was a way to trim the space each time so they match up?

    All suggestions are welcome

    Thanks
     
    , May 9, 2014
    #1
    1. Advertisements

  2. Since this newsgroup deals with VBA for Word, you might have better
    luck posting in one that deals with macros for Excel.

    On Fri, 9 May 2014 11:25:06 -0700 (PDT), wrote:

    >Hi all,
    >
    >I have two tabs within an excel file, each with two columns. The first column in each tab has titles such as "A1" "A2", etc. that are the same between the two tabs. The second column in each tab is for values corresponding to each value.
    >
    >Im copying data from the second tab to the first tab. So I want to write a program that identifies the titles in the first tab, finds which ones in the second tab match to it, and then copy the corresponding value for that title from the second tab to the first tab--this is because the second tab, the source, has some extra titles and values that arent needed. I only need values for the titles in the first tab.
    >
    >Now i have that all done--im matching the titles. My only problem is if the title in one tab is "A1 " (note the space) and the second title is "A1", it wont identify them as the same.
    >
    >Is there a way to make it identify only the letters? Or one other thing I was thinking was if there was a way to trim the space each time so they match up?
    >
    >All suggestions are welcome
    >
    >Thanks


    --
    Remove del for email
     
    Barry Schwarz, May 10, 2014
    #2
    1. Advertisements

  3. Stefan Blom Guest

    You could ask in an Excel newsgroup.

    However, you may have more luck in an Excel forum in the Microsoft
    Community. Go to
    http://answers.microsoft.com/en-us/office/forum/excel?sort=lastreplydate&dir=desc&tab=Threads
    and/or the Office programming forum at
    http://answers.microsoft.com/en-us/office/forum/customize?sort=lastreplydate&dir=desc&tab=Threads.

    --
    Stefan Blom
    Microsoft Word MVP




    <> wrote in message
    news:...
    > Hi all,
    >
    > I have two tabs within an excel file, each with two columns. The first
    > column in each tab has titles such as "A1" "A2", etc. that are the same
    > between the two tabs. The second column in each tab is for values
    > corresponding to each value.
    >
    > Im copying data from the second tab to the first tab. So I want to write a
    > program that identifies the titles in the first tab, finds which ones in
    > the second tab match to it, and then copy the corresponding value for that
    > title from the second tab to the first tab--this is because the second
    > tab, the source, has some extra titles and values that arent needed. I
    > only need values for the titles in the first tab.
    >
    > Now i have that all done--im matching the titles. My only problem is if
    > the title in one tab is "A1 " (note the space) and the second title is
    > "A1", it wont identify them as the same.
    >
    > Is there a way to make it identify only the letters? Or one other thing I
    > was thinking was if there was a way to trim the space each time so they
    > match up?
    >
    > All suggestions are welcome
    >
    > Thanks
    >
     
    Stefan Blom, May 10, 2014
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Jeff Hall
    Replies:
    3
    Views:
    182
    Jeff Hall
    Oct 18, 2003
  2. Terry VanDuzee

    identify optionbutton in cell

    Terry VanDuzee, Oct 24, 2003, in forum: Word VBA
    Replies:
    1
    Views:
    86
    guess who
    Oct 26, 2003
  3. yasmin
    Replies:
    3
    Views:
    1,301
    Jezebel
    Mar 6, 2006
  4. John Doue
    Replies:
    3
    Views:
    182
    Jay Freedman
    Sep 20, 2006
  5. Alex Wenzel
    Replies:
    2
    Views:
    143
    Alex Wenzel
    Oct 29, 2006
  6. shorty
    Replies:
    2
    Views:
    146
    Gordon Bentley-Mix
    Mar 22, 2009
  7. Alan Stancliff
    Replies:
    3
    Views:
    161
    Helmut Weber
    Apr 18, 2009
  8. dedawson
    Replies:
    4
    Views:
    1,311
    dedawson
    Dec 1, 2010
Loading...