Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a day and copy
Hi everyone , Could you please help with this code :
1) copy from "Source.xls" the "C2" range.... Is a date "22/06/04" 1) in "target.xls" the column "A" have 31 rows(days)= 1 Month 3) if the DAY in "source.xls" is the same in "target.xls", column "A", then paste from "Source.xls" the Range("G1:G10")in target.xls into a single line, and then find another day.... The purpose is to keep a log of the sales, amounts and the date onto this "target" workbook. My difficulty is coming up with the code to find the same day and then paste. Thanks a lot... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find a day and copy
Carlitos,
You don't say what the worksheet names involved a I will assume "SourceSheet1" for the Source.xls, and "TargetSheet1" for the Target.xls: Sub Carlitos() Dim myRow As Long Dim myDate As Date Workbooks("Source.xls").Worksheets("SourceSheet1") _ .Range("G1:G10").Copy Workbooks("Target.xls").Activate Worksheets("TargetSheet1").Select myDate = Workbooks("Source.xls"). _ Worksheets("SourceSheet1").Range("C2").Value myRow = Range("A1:A32").Find(myDate).Row Range("B" & myRow).Select Selection.PasteSpecial Transpose:=True End Sub HTH, Bernie MS Excel MVP "Carlitos" wrote in message om... Hi everyone , Could you please help with this code : 1) copy from "Source.xls" the "C2" range.... Is a date "22/06/04" 1) in "target.xls" the column "A" have 31 rows(days)= 1 Month 3) if the DAY in "source.xls" is the same in "target.xls", column "A", then paste from "Source.xls" the Range("G1:G10")in target.xls into a single line, and then find another day.... The purpose is to keep a log of the sales, amounts and the date onto this "target" workbook. My difficulty is coming up with the code to find the same day and then paste. Thanks a lot... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy contents of Find (Find and Replace) | Excel Discussion (Misc queries) | |||
Find and copy | Excel Discussion (Misc queries) | |||
find and copy | Excel Worksheet Functions | |||
Copy and Find | Excel Programming | |||
Find and Copy ? | Excel Programming |