PC Review


Reply
Thread Tools Rate Thread

Copy data matching date and retain information in a monhtly report

 
 
=?Utf-8?B?VGlnZXI=?=
Guest
Posts: n/a
 
      20th Aug 2007
I have 2 spreadsheets, dailydata and datamonth. I need a macro which looks up
the date in dailydata which is in a fixed location, and then finds the
matching date in datamonth across a row of monthly dates (e.g. 01 jul to 31
jul) and pastes values from dailydata below the matching date in datamonth.

dailydata
3-Jul-07
Start End time
1 7 6

Datamonth
Dates 2-Jul-07 3-Jul-07 4-Jul-07
Start Run 1
End Run 7
Run Time 6

Note that I need to retain the data, when I change the date it updates the
cells for that date and must keep the data for the previous day. Is there a
way to do
this? Note also need to retain data as detailed below.

Dailydata will have new values for each day. The update needs to read and
paste as a value only into datamonth, it cant copy the cell as the formula in
the cell will be a problem . Also there are some blank cells between some of
the info in dailydata so how do you handle this? e.g info cells A3-C3, then
F3, then H3-L3


My thought was to have a macro that found the matching date from dailydata
in monthdata, and tthen using a series of range copies to trasfer the data to
monhtdata. I have tried but unsure on how to code the if loop,

open to suggestions, can email spreadsheets if that helps, thanks

Tiger






 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      20th Aug 2007
Sub getdaily()

Const DailyFolder = "c:\temp"

Workbooks.Open (DailyFolder & "\DailyData.xls")

DailyDate = Range("A1")

ThisWorkbook.Activate
LastColumn = Cells(1, Columns.Count).End(xlToLeft).Column
Set DateRange = Range(Cells(1, "B"), Cells(1, LastColumn))

For Each cell In DateRange

If cell = DailyDate Then
With Workbooks("DailyData.xls").ActiveSheet
cell.Offset(rowoffset:=1, columnoffset:=0) = _
.Range("A3")
cell.Offset(rowoffset:=2, columnoffset:=0) = _
.Range("B3")
cell.Offset(rowoffset:=3, columnoffset:=0) = _
.Range("C3")
End With
Exit For
End If
Next cell
End Sub


"Tiger" wrote:

> I have 2 spreadsheets, dailydata and datamonth. I need a macro which looks up
> the date in dailydata which is in a fixed location, and then finds the
> matching date in datamonth across a row of monthly dates (e.g. 01 jul to 31
> jul) and pastes values from dailydata below the matching date in datamonth.
>
> dailydata
> 3-Jul-07
> Start End time
> 1 7 6
>
> Datamonth
> Dates 2-Jul-07 3-Jul-07 4-Jul-07
> Start Run 1
> End Run 7
> Run Time 6
>
> Note that I need to retain the data, when I change the date it updates the
> cells for that date and must keep the data for the previous day. Is there a
> way to do
> this? Note also need to retain data as detailed below.
>
> Dailydata will have new values for each day. The update needs to read and
> paste as a value only into datamonth, it cant copy the cell as the formula in
> the cell will be a problem . Also there are some blank cells between some of
> the info in dailydata so how do you handle this? e.g info cells A3-C3, then
> F3, then H3-L3
>
>
> My thought was to have a macro that found the matching date from dailydata
> in monthdata, and tthen using a series of range copies to trasfer the data to
> monhtdata. I have tried but unsure on how to code the if loop,
>
> open to suggestions, can email spreadsheets if that helps, thanks
>
> Tiger
>
>
>
>
>
>

 
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
Find matching date in another worksheet, copy and paste data =?Utf-8?B?U2hvbmV5?= Microsoft Excel Misc 1 8th Nov 2007 11:45 PM
macro copy data wb1 matching date to wb2 =?Utf-8?B?TWFjcm9tdXRl?= Microsoft Excel Misc 0 7th Aug 2007 07:16 AM
macro copy data from one workbook to other by matching date =?Utf-8?B?VGlnZXI=?= Microsoft Excel Misc 0 27th Jul 2007 05:58 AM
How can I export emails and retain the date received information =?Utf-8?B?Sm9obm55IFJpbmdv?= Microsoft Outlook 1 26th Jul 2006 09:59 AM
Re: Move Information with Matching date to Another Worksheet Frank Kabel Microsoft Excel Misc 2 9th Mar 2004 09:58 PM


Features
 

Advertising
 

Newsgroups
 


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