#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Daily cell update

Here's what I'd like to do:

The value in cell A1 changes every day. Can that value be
automatically recorded each day into a list that compiles what the
value was each day?

For example, if on Monday A1 is 65, Tuesday its 57, Wednesday its 48,
then the list would look like so:

Mon 65
Tues 57
Wed 48

and so on.

Any ideas??

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Daily cell update

Hi Matt,

First question is do you want a macro to do this? If so then the possible
methodology is:-

A Macro to automatically run when the workbook is opened.

Initially the macro should compare the current date with a date saved
somewhere out of the way in the workbook.

If the current date is greater than the date saved in the workbook,
automatically run a process to append the previous day/date and the required
value to the list and then copy the current date to the saved date in the
workbook.

The above would then only allow the process to take place the first time the
workbook is opened on any day. All future opening of the workbook during the
same day will compare the current date and saved date as equal and so exit
the procedure.

If you would like me to write the macro as above then let me know. However
it will help if you can answer the following for me:-

Do you require instructions to copy the macro into the workbook? (It will be
a Workbook level event).

In the list created, will it be only weekdays or all days of the week? It is
possible to test for the previous day to check if Sat or Sun and use Fri in
lieu if that is what you want.

Do you only want the Day of Week or the Day of Week plus the Date shown in
the list.

Name of the worksheet and the cell address where you want to start the list.

Is the value to be copied always from the same cell address? If so, name of
the worksheet and cell address. If not, I will need some info on the setout
of the sheet so the macro can locate it. For example always at the bottom of
a list commencing at cell D1 or always the last cell in column D.


Regards,

OssieMac

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Daily cell update

Sounds like this is best done using a macro? If so, then yes, help
with that macro would be appreciated. I do know how to input the
macro at workbook level. It can calculate every day of the week or
just weekdays, either is fine, whatever makes the programming
simpler. It would also be good to show the date along with the day.
Finally the worksheet will be called Daily Tracking and the list can
start in A15. Thank you for your help!

Matt

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Daily cell update

Hi again Matt,

Macro below. You didnt tell me where to copy the daily total from so I just
dummied a total for testing purposes. Can you fix that part or if not, can
you give me some info as per my previous posting.

You will have to initialize the first date at cell A15. (Or any cell in
column A so long as it does not have any data in cells below it otherwise the
macro will fail). Just put yesterdays date in. The macro needs this to run.

You will see that it always appends todays date to the bottom of the list
and then tomorrow it will enter the total against the existing date. That way
I was able to use the date at the bottom of the list to determine if the
macro has been run. Also it will ignore any days that the workbook is not
opened.

I dont know what part of the world you are in so you may have to edit the
date format. In case you are not fully familiar with custom formatting dates,
the format I have used of €œddd dd mmm yyyy€ will display a date as Wed 19 Sep
2007 which achieves the day of the week and the date together.



Private Sub Workbook_open()

Dim dateToday As Date
Dim rngLastDate As Range
Dim lastDayTot As Variant

dateToday = Date

'Following line needs to be edited to pick
'up the total from your worksheet
lastDayTot = 10

With Sheets("Daily Tracking")
Set rngLastDate = .Cells(Rows.Count, 1).End(xlUp)
If rngLastDate.Value < dateToday Then
rngLastDate.Offset(0, 1) = lastDayTot
rngLastDate.Offset(1, 0) = dateToday

'Edit date format to your requirements
.Columns("A:A").NumberFormat _
= "ddd dd mmm yyyy"
.Columns("A:A").Columns.AutoFit
End If
End With

End Sub

Feel free to get back to me if you have any problems with it.

Regards,

OssieMac


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default Daily cell update

One more thing. Copy and paste the macro into ThisWorkbook.

Regards,

OssieMac


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
Linking Daily Worksheet To Daily Invoice Total KJames Excel Worksheet Functions 1 March 18th 07 11:01 AM
how do i automatically update % figures daily JohnM Excel Discussion (Misc queries) 5 September 11th 06 05:52 PM
How do I do a formula to update numbers daily? bo922 Excel Worksheet Functions 0 March 8th 06 08:08 PM
Auto update daily report problem SteveG Excel Discussion (Misc queries) 4 February 9th 06 08:25 PM
how can I update stock prices daily into excel tbwillis Excel Discussion (Misc queries) 2 January 6th 06 03:45 AM


All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright İ2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"