ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy Data from another sheet (https://www.excelbanter.com/excel-discussion-misc-queries/153961-copy-data-another-sheet.html)

tnederlof

Copy Data from another sheet
 
Hey everyone, I have a big excel sheet with lots of formulas, macros,
ect but the one problem I have is that right now I have to load two
pages of data into the workbook each time I want to update everything.
I have to download the data and then I end up with two books...
Sheet_1.xls and Sheet_2.xls the first book has one sheet and needs
to be copied into the master book (sheet "raw data") and the second
book has one sheet which needs to be copied into the master book
(sheet "raw data2).

I would like to have a macro that would let the user in a dialog box
select where the files are located, have them open and copy their
sheets into the master. Is this possible? if so please help.

Thanks.


John Bundy

Copy Data from another sheet
 
mySheet = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls),*.xls", Title:="Choose Files",
MultiSelect:=False)

'Make sure a file was selected
If mySheet = "False" Then
MsgBox "No file selected, please select a file", vbCritical
Exit Sub
End If

Workbooks.Open mySheet
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"tnederlof" wrote:

Hey everyone, I have a big excel sheet with lots of formulas, macros,
ect but the one problem I have is that right now I have to load two
pages of data into the workbook each time I want to update everything.
I have to download the data and then I end up with two books...
Sheet_1.xls and Sheet_2.xls the first book has one sheet and needs
to be copied into the master book (sheet "raw data") and the second
book has one sheet which needs to be copied into the master book
(sheet "raw data2).

I would like to have a macro that would let the user in a dialog box
select where the files are located, have them open and copy their
sheets into the master. Is this possible? if so please help.

Thanks.



John Bundy

Copy Data from another sheet
 
Hit the button too soon. Just create a sub and put this in there, it will
open the selected file. Change or erase the file type section to suit what
file type you are getting.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"John Bundy" wrote:

mySheet = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls),*.xls", Title:="Choose Files",
MultiSelect:=False)

'Make sure a file was selected
If mySheet = "False" Then
MsgBox "No file selected, please select a file", vbCritical
Exit Sub
End If

Workbooks.Open mySheet
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"tnederlof" wrote:

Hey everyone, I have a big excel sheet with lots of formulas, macros,
ect but the one problem I have is that right now I have to load two
pages of data into the workbook each time I want to update everything.
I have to download the data and then I end up with two books...
Sheet_1.xls and Sheet_2.xls the first book has one sheet and needs
to be copied into the master book (sheet "raw data") and the second
book has one sheet which needs to be copied into the master book
(sheet "raw data2).

I would like to have a macro that would let the user in a dialog box
select where the files are located, have them open and copy their
sheets into the master. Is this possible? if so please help.

Thanks.



tnederlof

Copy Data from another sheet
 
On Aug 13, 10:18 am, John Bundy (remove) wrote:
Hit the button too soon. Just create a sub and put this in there, it will
open the selected file. Change or erase the file type section to suit what
file type you are getting.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.

"John Bundy" wrote:
mySheet = Application.GetOpenFilename( _
filefilter:="Excel Files (*.xls),*.xls", Title:="Choose Files",
MultiSelect:=False)


'Make sure a file was selected
If mySheet = "False" Then
MsgBox "No file selected, please select a file", vbCritical
Exit Sub
End If


Workbooks.Open mySheet
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"tnederlof" wrote:


Hey everyone, I have a big excel sheet with lots of formulas, macros,
ect but the one problem I have is that right now I have to load two
pages of data into the workbook each time I want to update everything.
I have to download the data and then I end up with two books...
Sheet_1.xls and Sheet_2.xls the first book has one sheet and needs
to be copied into the master book (sheet "raw data") and the second
book has one sheet which needs to be copied into the master book
(sheet "raw data2).


I would like to have a macro that would let the user in a dialog box
select where the files are located, have them open and copy their
sheets into the master. Is this possible? if so please help.


Thanks.


thanks for your help, I get an error in the first part of the macro
everytime I run it, could you tell me where to put the code on
different lines please? Also once the sheet is opened how do I get it
to copy sheets off of this page.

Thanks again!



All times are GMT +1. The time now is 08:38 PM.

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