Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default copy and paste values

I have 11 workbooks open, wb1 through wb10 and wbA. Wb1 through wb10 have a
range of information, a1:e20, in each workbook that needs to be copied and
paste the values to wbA beginning at cell a1 in sheet1. The contents of the
range in each of the 10 workbooks, wb1 through wb10, needs to be stacked one
below the next in wbA beginning at cell a1.

How??
--
l-hawk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default copy and paste values

Try something like this. It's untested and probalby needs to have the
workbooks declared.

Sub test()
Dim wb As Workbook
Dim mySheet As Worksheet
Dim mySheeta As Worksheet

Dim myRange As Range
Dim myNewRange As Range

Set mySheeta = Nothing
On Error Resume Next
Set mySheeta = wba.Sheets("Sheet1")
On Error GoTo 0

If mySheeta = Nothing Then Exit Sub

For Each wb In Application.Workbooks
If wb.Name < wba.Name Then
Set mySheet = Nothing

On Error Resume Next
Set mySheet = wb.Sheets("Sheet1")
On Error GoTo 0
If Not mySheet Is Nothing Then
lrow = mySheet.Cells(wb.Rows.Count, 1).End(xlUp).Row
Set myRange = mysheet.Range("a1:e20")
Set myNewRange = mysheeta.Cells(lrow + 1,
1).Resize(myRange.Rows, myRange.Columns)
myNewRange.Value = myRange.Value

End If
End If
Next wb
End Sub


"hawki" wrote:

I have 11 workbooks open, wb1 through wb10 and wbA. Wb1 through wb10 have a
range of information, a1:e20, in each workbook that needs to be copied and
paste the values to wbA beginning at cell a1 in sheet1. The contents of the
range in each of the 10 workbooks, wb1 through wb10, needs to be stacked one
below the next in wbA beginning at cell a1.

How??
--
l-hawk

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 / paste as values KRK New Users to Excel 1 March 21st 10 12:49 PM
Copy and paste up to values in last row Scott Excel Discussion (Misc queries) 2 September 23rd 09 10:23 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy/Paste Values briank Excel Programming 5 May 27th 05 05:20 PM
How do i compare values from two sheet and copy & paste if values match? rozb Excel Programming 0 March 5th 04 12:06 AM


All times are GMT +1. The time now is 05:43 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"