Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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
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 contents of Find (Find and Replace) rob_bob Excel Discussion (Misc queries) 0 March 26th 09 11:01 PM
Find and copy Rodjk #613 Excel Discussion (Misc queries) 6 April 13th 07 01:06 AM
find and copy Lost Excel Worksheet Functions 1 October 1st 05 06:15 PM
Copy and Find Mike Excel Programming 1 December 10th 03 09:39 PM
Find and Copy ? Robert Gillard Excel Programming 1 October 7th 03 02:35 AM


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

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"