Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trasferring data from current workbook to a new workbook

Status
Not open for further replies.

TBL3

Programmer
Jun 6, 2011
50
CA
Hi,

I currently completed building a template that requires many fields to be inputted.
However, my concern is that I would like to build a macro that can transfer all the data that I have inputted already in the current template into a new template with the exact same format.

One thing to make a note is that the fields are not continguous. Also, I would like to have a macro that goes on the line with 'GetOpenFilename' functionality due to making it for the users to be clear in which file it will get transferred to.
Lastly, there are some cells that are merged, hence, when the transfer of data occurs, hopefully the merged cells will become unmerged.


Any suggestions would be great.


Thanks,
Tbl3
 



Hi,

Use MS Query to PULL the data into a new workbook without VBA.

faq68-5829



Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi,

I believe using MS Query wouldn't work.
After reviewing the site you have linked, one of the requirements is to form a table of somesort or using tables.

However, the cells I would like to transfer are not in a table format, but is more similar to an application form.

Am I understanding the use of MS Query wrong?
 



Code:
with workbooks.add
   thisworkbook.sheets("SheetYouWantToCopy").cells.copy
   .sheets(1).cells(1,1).pastespecial xlpasteall
end with
[/coce]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
[b]for a NUANCE![/b][tongue][/sub]
 
I don't think I will use the code you have.
I will just go with using GetOpenFilename App.
To be honest, don't fully understand your code on how to incorporate to my case specifically.


Thanks
 



GetOpenFileName does nothing except get a STRING that represents a file that you want to open, for instance FileName.
Code:
with workbooks.[b]open FileName[/b]
   thisworkbook.sheets("SheetYouWantToCopy").cells.copy
   .sheets("SheetYouWantToPasteIn").cells(1,1).pastespecial xlpasteall
end with


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top