PC Review


Reply
Thread Tools Rate Thread

copy and paste values

 
 
=?Utf-8?B?aGF3a2k=?=
Guest
Posts: n/a
 
      28th Jun 2007
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 With Quote
 
 
 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      28th Jun 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy / paste as values KRK Microsoft Excel New Users 1 21st Mar 2010 12:49 PM
paste values without copy-paste values Rikkart Microsoft Excel Programming 1 15th Mar 2010 03:01 PM
Find matching values, copy/paste values as well as values in ColA ryguy7272 Microsoft Excel Programming 2 28th Sep 2009 06:20 AM
Copy/Paste how to avoid the copy of formula cells w/o calc values =?Utf-8?B?RGVubmlz?= Microsoft Excel Misc 10 2nd Mar 2006 10:47 PM
How do i compare values from two sheet and copy & paste if values match? =?Utf-8?B?cm96Yg==?= Microsoft Excel Programming 0 5th Mar 2004 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:09 AM.