Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default copy specific cells in workbook to new workbook

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default copy specific cells in workbook to new workbook


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
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 cells based on conditions in one workbook to another workbook fLiPMoD£ Excel Discussion (Misc queries) 0 August 1st 07 07:43 PM
Macro to copy specific cells from one workbook to another [email protected] Excel Programming 5 June 9th 06 05:27 PM
Macro to copy specific cells from one workbook to another [email protected] Excel Discussion (Misc queries) 4 June 9th 06 04:32 PM
Copy Data from Workbook into specific Worksheet in other Workbook? kingdt Excel Discussion (Misc queries) 1 March 16th 06 06:55 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


All times are GMT +1. The time now is 10:57 PM.

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"