Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying info from one workbook to another

I have to copy info from one workbook to another when the workbook layouts
will remain the same but the workbook names will change from session to
session. How do I indentify the open workbooks in my Macro?

Example "Book1" has a column for last name and age. I want to copy the
contents of the last name column and the value of the age column to two
different columns in another book I have opened up. I just can't seem to get
the syntax right. Any help would be greatly appreciated.

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Copying info from one workbook to another

This should give you what you want, and a whole lot more too:
http://www.rondebruin.nl/tips.htm

See the section titled 'Copy/Paste/Merge examples'


Regards,
Ryan---

--
RyGuy


"Slow Thinker" wrote:

I have to copy info from one workbook to another when the workbook layouts
will remain the same but the workbook names will change from session to
session. How do I indentify the open workbooks in my Macro?

Example "Book1" has a column for last name and age. I want to copy the
contents of the last name column and the value of the age column to two
different columns in another book I have opened up. I just can't seem to get
the syntax right. Any help would be greatly appreciated.

Thank you!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copying info from one workbook to another

Thanks Ryan, the page is loaded with info I know I will be able to use but I
still don't see how to get the macro to grab the names of the two open
workbooks to I can work with them.

Barb

"ryguy7272" wrote:

This should give you what you want, and a whole lot more too:
http://www.rondebruin.nl/tips.htm

See the section titled 'Copy/Paste/Merge examples'


Regards,
Ryan---

--
RyGuy


"Slow Thinker" wrote:

I have to copy info from one workbook to another when the workbook layouts
will remain the same but the workbook names will change from session to
session. How do I indentify the open workbooks in my Macro?

Example "Book1" has a column for last name and age. I want to copy the
contents of the last name column and the value of the age column to two
different columns in another book I have opened up. I just can't seem to get
the syntax right. Any help would be greatly appreciated.

Thank you!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Copying info from one workbook to another

You just select the elements that you want to include in the Pivot Table,
right. Are you talking about importing multiple .xls files? If so,m try
this macro:
Sub Import()
Dim Wb1 As Workbook
Dim Wb2 As Workbook
Dim x As Long
Dim FilesToOpen

FilesToOpen = Application.GetOpenFilename _
(FileFilter:="Text Files (*.xls), *.xls", _
MultiSelect:=True, Title:="Excel Files to Open")

Set Wb1 = ActiveWorkbook
For x = LBound(FilesToOpen) To UBound(FilesToOpen)
Set Wb2 = Workbooks.Open(Filename:=FilesToOpen(x))

Wb2.Worksheets.Copy _
After:=Wb1.Sheets(Wb1.Sheets.Count)

Wb2.Close False
Next x

End Sub

Again, import the data, build a summary sheet with all the data, and then
use this summary sheet as the basis for your Pivot Table. I do this all the
time; works fine for me...

Regards,
Ryan---

--
RyGuy


"Slow Thinker" wrote:

Thanks Ryan, the page is loaded with info I know I will be able to use but I
still don't see how to get the macro to grab the names of the two open
workbooks to I can work with them.

Barb

"ryguy7272" wrote:

This should give you what you want, and a whole lot more too:
http://www.rondebruin.nl/tips.htm

See the section titled 'Copy/Paste/Merge examples'


Regards,
Ryan---

--
RyGuy


"Slow Thinker" wrote:

I have to copy info from one workbook to another when the workbook layouts
will remain the same but the workbook names will change from session to
session. How do I indentify the open workbooks in my Macro?

Example "Book1" has a column for last name and age. I want to copy the
contents of the last name column and the value of the age column to two
different columns in another book I have opened up. I just can't seem to get
the syntax right. Any help would be greatly appreciated.

Thank you!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying info from worksheet to worksheet if info matches Carrach Excel Worksheet Functions 2 May 6th 10 09:52 AM
copying info from one workbook to another one Mago Excel Worksheet Functions 1 April 7th 09 11:49 PM
Copying info from one worksheet to another oscarooko[_12_] Excel Programming 2 December 23rd 05 11:16 PM
Copying info from one sheet to another Erik[_6_] Excel Programming 5 February 26th 04 11:51 PM
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please harry Excel Programming 5 December 20th 03 03:26 AM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"