+ Reply to Thread
Results 1 to 10 of 10

how to format column D to Paste a value based on Column A

  1. #1
    Registered User
    Join Date
    08-04-2013
    Location
    florida
    MS-Off Ver
    Excel 20010
    Posts
    5

    how to format column D to Paste a value based on Column A

    I am new to excel, but my small business vendors have gone to updated spreadsheets and have left of some of the usual fields off the datasheet


    so here is my question. I need to know how to make excel look at a value in column A and based on what is there place the correct words in column D

    example…,

    the warehouse sku = CNVEF-IGFFDVD228

    well the 2 or 3 letters after "-I" = different vendors

    Example #1 (3 letters after "-I")
    I need a way for excel to say if "GFF" is after "-I" then place ___ vendor name in column D

    example #2 (two letters after "-I")
    warehouse sku = CNVEF-IDSDVD1362
    I need a way for excel to say if "DS" is after "-I" then place ___ vendor name in column D


    I think its macros, but im not sure (if i posted in the wrong threat let me know)

    there are about 40 different vendors and 70,000 products that need to be like this., so the easiest way to do this would be helpful

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: how to format column D to Paste a value based on Column A

    attach please a sample file with current data and desired result
    Last edited by patel45; 08-04-2013 at 03:34 AM.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    08-04-2013
    Location
    florida
    MS-Off Ver
    Excel 20010
    Posts
    5

    Re: how to format column D to Paste a value based on Column A

    here is the sample file
    Attached Files Attached Files

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: how to format column D to Paste a value based on Column A

    Hi, desquaninc,

    how do we know that ABW is Jakes supply store? You could use the string strVendor you get from the code to use WorksheetFunction.VLookUp for the name in Column D.

    To give you a start (this will print the codes to the immediate Window):
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: how to format column D to Paste a value based on Column A

    where I can see data ? where desired result ? where vendors code ?

  6. #6
    Registered User
    Join Date
    08-04-2013
    Location
    florida
    MS-Off Ver
    Excel 20010
    Posts
    5

    Re: how to format column D to Paste a value based on Column A

    the vendor codes are the first 2 or 3 letters after "-i"

    CNVEF-IABWDVD102 so the vendor code here would be "ABW"

    CNVEF-IDSDVD1362 so the vendor code here would be "DS"

    i will attach the sample sheet again..,
    Attached Files Attached Files

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: how to format column D to Paste a value based on Column A

    Hi, desquaninc,

    no new information in that workbook - please don´t post the same data more than once but care to deliver what´s been asked. Besides: my code takes care of the vendor code (at least with your sample data) but I won´t get on as the other informtion (the table with the data for the vendors or the information where it is located) is missing.

    @patek45:
    I´m glad to tell you there is a preview which might be used prior to submitting an answer (there can´t be any error in your browser as you have edited your own post prior to answering - sometimes it´s nice that vBulletin states this).

    Ciao,
    Holger

  8. #8
    Registered User
    Join Date
    08-04-2013
    Location
    florida
    MS-Off Ver
    Excel 20010
    Posts
    5

    Re: how to format column D to Paste a value based on Column A

    Hi, HaHoBe,

    I was answering @patek45, since he asked a specific question.

    I am new to excel i see your code, and I am not sure what to do with it.

    deliver what was asked? thats what i was doing by replying to patek45,

    do you want the completed list of vendors to provide me with a fix?

    I don't understand what it is that hasnt been provided

  9. #9
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: how to format column D to Paste a value based on Column A

    Hi, desquaninc,

    regarding your opening post
    I need to know how to make excel look at a value in column A and based on what is there place the correct words in column D
    This step might be resolved by using a Formula. Please enter this formula into E1 in your sample and then drag it down to the end of the data set:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The second step would be to use this string in a lookup formula to find the code and deliver the long name. Let´s assume this list is on a sheet named Data with the codes in Column A and the company name in Column B then please enter this formula into F1 on the sample (Sheet Data needs to be in the same workbook else needs to be "qualified" with the workbook´s name):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag down to the end of the data. (It´s this information that is missing in your workbook.)

    These two steps can be put into one formula for D1 like
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    which isn´t that self-explanatory as the two steps before.

    VBA:
    This process can be automated via VBA to paste values instead of formulas. Assuming the table on sheet Data as before the code may look like
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    You would need to save the workbook as macro enabled, set the settings in the options for the trusted locations (if not already done) and allow macros to be executed. You should try the macro on a copy (maybe copy the sheet inside the workbook for a test and clear column D there to see if the macro does what it is supposed to do).

    HTH,
    Holger

  10. #10
    Registered User
    Join Date
    08-04-2013
    Location
    florida
    MS-Off Ver
    Excel 20010
    Posts
    5

    Re: how to format column D to Paste a value based on Column A

    Thank you for your help, I will try that.

+ 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. Conditional Format an Entire Column based on percentage of another Column
    By Nolson24 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-29-2013, 09:23 AM
  2. Format column based on column header
    By freebird_wr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2013, 03:46 PM
  3. Replies: 1
    Last Post: 03-02-2013, 05:06 AM
  4. Condition Paste Formula in Column N based on Column A
    By tek9step in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2009, 04:58 PM
  5. conditionally format a column based upon another column
    By jcavigli in forum Excel General
    Replies: 1
    Last Post: 06-29-2009, 11:40 PM

Tags for this Thread

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