+ Reply to Thread
Results 1 to 5 of 5

creating .csv output from 2 worksheets

  1. #1
    Registered User
    Join Date
    07-29-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    creating .csv output from 2 worksheets

    Hi All,
    My question is how to create a .csv file from 2 worksheets, selecting columns from each.
    The example workbook i've attached has 2 tabs:
    - InputTemplate
    - Mapping

    the Submit button creates a basic .csv based on a range associated with InputTemplate worksheet.

    I want to export columns B, C , D, E, H, L, P, T from Input Template worksheet and then lookup and match the columns B, D and F from Mapping worksheet for each row.

    So for row 1 it looks up codes for BBC1, Local and BOB and finds their associated Base Level ID, so it will look like:
    EUR,BBC1,LOCAL,BOB,195,80,259,178,2000,100,10
    where the last3 columns are 2000 = 'BBC1' base level feed ID, 100 = 'Local' Deal Type Base Level ID, 10 = 'BOB' Salesperson Base Level ID

    Any help to get me going would be highly appreciated,

    goodwinh
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: creating .csv output from 2 worksheets

    This was fun
    Please Login or Register  to view this content.
    -Greg If this is helpful, pls click Star icon in lower left corner

  3. #3
    Registered User
    Join Date
    07-29-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: creating .csv output from 2 worksheets

    Hi there,
    Firstly thanks gjlindn for your help.
    I've updated the .xlsm with the code posted by gjlindn, which looks like it will do the job but errors on the vlookup section.
    Am curently trying to de-bug this but any help appreciated,

    regards
    goodwinh
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-29-2011
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: creating .csv output from 2 worksheets

    Hi,
    I've updated the code in the attached Example.xlsm file., and removing the square brackets let it execute ok.
    It now runs and creates the .csv but it does not find anything.
    I shall continue, but if anybody can help that would be fully appreciated,
    Here's the code as well,
    Please Login or Register  to view this content.
    goodwinh
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: creating .csv output from 2 worksheets

    Hi goodwinh. Sorry to take so long to respond. It's been a really busy week for me. The brackets in my first post are necessary for the VLOOKUP formula to retrieve data from another workbook. If your workbook name contains spaces, it's probably failing because you're missing the single quotes (I didn't put them in the original code). This should correct that issue.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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