Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to to get values for specific date and copy to cells
Hello,
This is a follow up post to "Macro better solution than cell formula with date?" Bob, thank you, your code did exactly what I asked for but I have found a need for more processes and my modifications to your code resulted in errors and unexpected results. In the example below Col B is the current day stock price (from ESQuotesdotcom). Date Bought, C2,3,4, are filled by user. D and F are, except D1 and F1, cell formulas to calculate the day bought plus 1. E and G are empty. I have twenty pairs of Date/Price columns, so in this example, AP AQ should be the last 2 Cols., and 50 total Rows available for future entries. The actual Date/Price Cols in my worksheet start on AL and end on BW. Row 1 has the current day and subsequent days already filled in D1,F1 and on and are cell formulas calculated off of a base date entered by the user, say in cell C1. The worksheet would be opened and updated daily. What I have tried to get a macro to do (failed miserably) is - - If the day the worksheet is opened is the current day (D1, F1, H1, etc.), get the values in Col B and place them in the proper cells in Col E and continue this same process when opened on subsequent days. Hope this is not too much info. Seems like a simple process but beyond my capabilites. Open to suggestions and definately to solutions! Thanks for any responses in advance. A B C D E F G Symbol Price Date Date Bought Plus 1 Day Bought Date Price Date Price Row 1 Current Day (4/22/05) 4/23/05 4/24/05 Row 2 EFFI $16 4/12/05 4/13/05 4/14/05 Row 3 SHOE $7 4/2/05 4/4/05 4/5/05 Row 4 MSFT $89 4/19/05 4/20/05 4/21/05 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to to get values for specific date and copy to cells
Have you thought about using MS Access? would be so much easier
"LLr" wrote: Hello, This is a follow up post to "Macro better solution than cell formula with date?" Bob, thank you, your code did exactly what I asked for but I have found a need for more processes and my modifications to your code resulted in errors and unexpected results. In the example below Col B is the current day stock price (from ESQuotesdotcom). Date Bought, C2,3,4, are filled by user. D and F are, except D1 and F1, cell formulas to calculate the day bought plus 1. E and G are empty. I have twenty pairs of Date/Price columns, so in this example, AP AQ should be the last 2 Cols., and 50 total Rows available for future entries. The actual Date/Price Cols in my worksheet start on AL and end on BW. Row 1 has the current day and subsequent days already filled in D1,F1 and on and are cell formulas calculated off of a base date entered by the user, say in cell C1. The worksheet would be opened and updated daily. What I have tried to get a macro to do (failed miserably) is - - If the day the worksheet is opened is the current day (D1, F1, H1, etc.), get the values in Col B and place them in the proper cells in Col E and continue this same process when opened on subsequent days. Hope this is not too much info. Seems like a simple process but beyond my capabilites. Open to suggestions and definately to solutions! Thanks for any responses in advance. A B C D E F G Symbol Price Date Date Bought Plus 1 Day Bought Date Price Date Price Row 1 Current Day (4/22/05) 4/23/05 4/24/05 Row 2 EFFI $16 4/12/05 4/13/05 4/14/05 Row 3 SHOE $7 4/2/05 4/4/05 4/5/05 Row 4 MSFT $89 4/19/05 4/20/05 4/21/05 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Countif certain values on specific date | Excel Worksheet Functions | |||
Count zero values before specific date | Excel Worksheet Functions | |||
Macro to find matching date and copy values to another sheet | Excel Discussion (Misc queries) | |||
Macro to copy specific cells from one workbook to another | Excel Discussion (Misc queries) | |||
Automatically Copy Specific Values to a Different Spreadsheet? | Excel Discussion (Misc queries) |