+ Reply to Thread
Results 1 to 3 of 3

Help with basic copying and pasting data to a summary sheet

  1. #1
    Registered User
    Join Date
    07-04-2017
    Location
    uk
    MS-Off Ver
    13
    Posts
    2

    Help with basic copying and pasting data to a summary sheet

    i need an excel vba script

    to ask the user to open a workbook by choosing the folder and file

    copy specific cells in the various worksheets in that workbook (eg "sheet1 a1 to variable firstname", "sheet2 b2 to variable surname" "sheet3 c3 to variable age" and close the workbook

    open a seperate workbook in a specific location (eg c:\results) and name the it summary

    copy the previously variables to the new summary sheet under the headers of firstname surname and age

    drop to the next line and ask if another workbook is required, if so, bring up the file dialogue box again open the specified workbook copy the new data (it will be in the same locations) underneath the previous data

    continue until the answer is no to another workbook requiring to be opened

    save the "summary" workbook and exit.

    i also need another seperate code to do the same but if it could automatically get the data from a specific directory/folder (eg all files beginning nis???)instead of having to individually specify the files

    the file the user is opening brings up the question do you want to open as read only and when closing a reminder to save any changes to the original file, i dont want to change anything and obviously dont want to save so can these message boxes not appear?

    Thanks in advance this would be a life saver :-)

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Help with basic copying and pasting data to a summary sheet

    I have a couple of questions about the requirement.

    Data is to be appended to the summary workbook; never overwritten.

    For the file being opened, is there only one row of data (row 2)? If not, I will assume that you want all rows copied.

    For the second requirement - you need a way to keep from processing files already processed. One way to do this is to move the file to a "finished" directory after it's been processed. Is this acceptable?
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    07-04-2017
    Location
    uk
    MS-Off Ver
    13
    Posts
    2

    Re: Help with basic copying and pasting data to a summary sheet

    hi there, yes once the summary workbook is completed (user doesnt require anymore workbooks added to the summary) everything closes
    on the workbook the user picks to open it will copy various cells on various sheets in that workbook and stick them all on one row on the seperate summay workbook, then drop down onto the next row for the next user required workbook (a simple loop)
    to stop from processing already processed books (in the manual example the user picks the files so no problem, in the automatic example maybe copy fthe files in the folder to the sheet and drop down each cell/filename till the end is reached?)

    The initial scenario is the basic version and with the code i could just increase the cells required and locations/sheets to fit whats required.

    Hope that explains a bit better

    Thanks a lot

+ 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. Basic Q: Copying column data from one sheet to another -- with a few weird aspects
    By keough_slc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-12-2016, 02:46 AM
  2. Replies: 8
    Last Post: 02-01-2016, 09:30 AM
  3. Replies: 2
    Last Post: 02-27-2012, 10:45 PM
  4. Copying data from separate worksheets to one summary sheet
    By Ivor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2011, 12:58 PM
  5. Copying a template sheet and putting those multiple sheets data into a summary sheet
    By John Wolfe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2011, 06:29 PM
  6. copying data from sheets in workbook to summary sheet in same
    By Nets in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-19-2009, 03:49 PM
  7. Code not copying and pasting data - basic error?
    By Kayote in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2008, 10:57 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