PC Review


Reply
Thread Tools Rate Thread

copy specific cells in workbook to new workbook

 
 
=?Utf-8?B?cGxvZGRpbmdnYWx0bg==?=
Guest
Posts: n/a
 
      20th Oct 2006
I have 3 reports that I want to summerize into one. If I get help some basic
help, I should be able to create the summary. I need to copy about 10 rows
from each report into the recap and need to call them individually I believe.
For example

For the workbook "GESS CC", I want to take the data in col b where col A
states, "Total MC Payments" and move it to Row 6, Col B in workbook titled,
"Recap". I also want to take the data in that same workbook from col b where
col A states, Total MC Payment Amount" and move it to Row 7, Col B in the
Recap workbook.

Those are 2 cells I want to move and I have about 28 more to go but if
somebody can help me with these, I should be OK to figure out the rest.
Thanks


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      20th Oct 2006

Sub ProcessData()
Dim sh as worksheet, sh1 as Worksheet
Dim bk as Workbook, bk1 as Workbook
Dim v as Variant, v1 as Variant
Dim s as String
Dim rng1 as Range, i as long
v = Array("Total MC Payments", _
"Total MC Payment Amount", _
. . . Additional . . . )

v1 = Array("B6","B7", . . . Additional . . .)

Set bk = Workbooks.Open("C:\MyFolder\Recap.xls")
Set sh = bk.Worksheets("Sheet1")
set bk1 = Workbooks.Open("C:\Myfolder\GESS CC.xls")
set sh1 = bk1.Worksheets("Sheet1")
for i = lbound(v) to ubound(v)
s = v(i)
Set rng1 = sh1.Columns(1).Find(What:=s, _
After:=sh1.Range("A65536"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
if not rng is nothing then
sh.Range(v1(i)).Value = rng1.Value
end if
Next i

.. . .

end sub

--
Regards,
Tom Ogilvy

"ploddinggaltn" wrote:

> I have 3 reports that I want to summerize into one. If I get help some basic
> help, I should be able to create the summary. I need to copy about 10 rows
> from each report into the recap and need to call them individually I believe.
> For example
>
> For the workbook "GESS CC", I want to take the data in col b where col A
> states, "Total MC Payments" and move it to Row 6, Col B in workbook titled,
> "Recap". I also want to take the data in that same workbook from col b where
> col A states, Total MC Payment Amount" and move it to Row 7, Col B in the
> Recap workbook.
>
> Those are 2 cells I want to move and I have about 28 more to go but if
> somebody can help me with these, I should be OK to figure out the rest.
> Thanks
>
>

 
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
Macro to copy specific data from master workbook to another workbook Mark767 Microsoft Excel Programming 13 1st Sep 2009 08:57 PM
Macro to copy specific cells from one workbook to another dwight.yorke@gmail.com Microsoft Excel Programming 5 9th Jun 2006 05:27 PM
Macro to copy specific cells from one workbook to another dwight.yorke@gmail.com Microsoft Excel Misc 4 9th Jun 2006 04:32 PM
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Microsoft Excel Misc 1 16th Mar 2006 06:55 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Microsoft Excel Programming 3 24th Jun 2004 12:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:54 PM.