ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   macro to browse for workbook, pick up data and looping (https://www.excelbanter.com/excel-worksheet-functions/16999-macro-browse-workbook-pick-up-data-looping.html)

uriel78

macro to browse for workbook, pick up data and looping
 
I've got several workbooks; in each workbook there are 4 sheets whose name
is the same for ale the workbooks (call'em sheet1,2,3,4).
In each sheets there are equally organized data (only values change form one
sheet to another)

In a new workbook ("summary") I wish I could have a macro that ask me to
choose a workbook (maybe without opening it), pick up and copy data in
sheet1 and paste in summary workbook. After doing this operation, I'd qant
to be prompt if select another file to do the same operation (choose
workbook, sheet, data ,copy& paste)...

Is it possible...?




Naomi

It is possible but the code is too long to write out here (and this is a
programming question rather than function!).
You would need code to do the following:

Input box to prompt for file name (or cancel)-
Inputbox(prompt, title etc)

Use result to open file-
Workbooks.open filename, readonly etc.

Copy across results and close file-
Worksheets.range().copy
Selection.pastespecial xlvalues
Workbooks().close savechanges=false

Repeat.


"uriel78" wrote:

I've got several workbooks; in each workbook there are 4 sheets whose name
is the same for ale the workbooks (call'em sheet1,2,3,4).
In each sheets there are equally organized data (only values change form one
sheet to another)

In a new workbook ("summary") I wish I could have a macro that ask me to
choose a workbook (maybe without opening it), pick up and copy data in
sheet1 and paste in summary workbook. After doing this operation, I'd qant
to be prompt if select another file to do the same operation (choose
workbook, sheet, data ,copy& paste)...

Is it possible...?






All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com