#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Paste Macro

dmac,

Copy this sub into an otherwise blank workbook, and then run it, and select the workbooks with the
data when you get the file select dialog.

Sub PullDataFromUserSelectedFiles()
Dim FileArray As Variant
Dim i As Integer
FileArray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(FileArray) Then
For i = LBound(FileArray) To UBound(FileArray)
Workbooks.Open FileArray(i)
ActiveSheet.Range("A2:X2").Copy
ThisWorkbook.Worksheets(1).Cells(Rows.Count, 1).End(xlUp)(2).PasteSpecial xlPasteValues
ActiveWorkbook.Close True
Next i
Else:
MsgBox "You clicked cancel"
End If
End Sub

HTH,
Bernie
MS Excel MVP


"dmac" .(donotspam) wrote in message
...
How do I write a macro that will paste a range of information (A2:X2) from
various workbooks of the same type and format to the next available line in a
secondary summary workbook? Secondly, if I create this macro in a workbook
and do "save as" will everything translate over correctly when I put in new
information? Basically what I'm doing is using the summary page to link to
Access for cost tracking purposes.



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
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Excel Programming 1 October 17th 05 08:56 AM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
Cut and Paste using Macro gives paste special method error Lourens Pentz Excel Programming 3 November 21st 04 10:42 PM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 06:55 PM.

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

About Us

"It's about Microsoft Excel"