Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy cells based on conditions in one workbook to another workbook | Excel Discussion (Misc queries) | |||
Macro to copy specific cells from one workbook to another | Excel Programming | |||
Macro to copy specific cells from one workbook to another | Excel Discussion (Misc queries) | |||
Copy Data from Workbook into specific Worksheet in other Workbook? | Excel Discussion (Misc queries) | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming |