+ Reply to Thread
Results 1 to 4 of 4

Creating New Worksheets, Copying Data to New Sheet Based on Matching Column Header

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    Madison, WI
    MS-Off Ver
    Excel 2010
    Posts
    8

    Creating New Worksheets, Copying Data to New Sheet Based on Matching Column Header

    Hi everyone,

    I'm having a lot of trouble getting this one to dance for me and really need some expert help.

    Basically, what I would like to have happen is as follows:

    1. User enters list of departments into column headers across Row 1 of 'Start' (labeled Worksheet Name)
    2. User clicks button
    3. Workbook automatically duplicates the 'Template' worksheet and renames each new sheet with a column header from 'Start' department (Step 1)
    4. Per column, the workbook copies the Patient name from 'Start' (i.e. 'Start' B2) to E2 of the corresponding duplicated sheet (column header in 'Start' and worksheet name must be equal)
    5. The workbook repeats step 4, copying the Department name (B3, C3, D3, etc.) to the corresponding duplicated sheet's E3
    6. The workbook repeats step 4, copying all Charges from 'Start' and pasting them down column D starting at D7

    All help is welcome and I'll be 100% here to answer any questions promptly! Worksheet is attached.
    Copy of Charge Testing Tracker- FSC Improved with Macros Draft 6.xlsm

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Creating New Worksheets, Copying Data to New Sheet Based on Matching Column Header

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-26-2012
    Location
    Madison, WI
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Creating New Worksheets, Copying Data to New Sheet Based on Matching Column Header

    This is gorgeous!!! Thank you so much!

  4. #4
    Registered User
    Join Date
    03-06-2017
    Location
    Portland, Oregon
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Creating New Worksheets, Copying Data to New Sheet Based on Matching Column Header

    Hello!
    Wow, this is so amazing! It works perfectly for something I've been trying to do - I seriously cannot thank you enough.

    Thank you so much - man I can not overstate how awesome this code is.
    Todd
    Last edited by tsummers; 03-09-2017 at 01:06 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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