View Single Post
 
Old 01-26-2011, 03:21 AM
tareq tareq is offline Windows 7 Office 2007
Novice
 
Join Date: Sep 2010
Posts: 15
tareq is on a distinguished road
Default

Quote:
Originally Posted by BjornS View Post
Hi again,
as I see it there are two main issues.

a) To make your macro work for 28-31 days
b) to add the extra rows for the hours "inbetween".

Regarding (a), it is not always easy to adjust an already recorded macro (much easier if it was "programmed"). One way of solving this is the following:
1) Re-record your macro for a month with 31 days (for example July).
2) Save this as your "permanent macro", that you in the future use for every month.
3) Run this macro for a short month (February, April, June etc). Please publish the result of this macro run (= how your excel sheet "my macro" looks like for april) here, so I can have a look at it. Then I can see if I can create an additional macro, that simply deletes the extra rows.

Regarding (b) I am looking at it, but I am quite busy the next 2-3 days.

Kind regards
Bjorn
Hi Bjorn,
Your macro worked PERFECTLY!! Thank you very much. Regarding deleting extra rows, you will see an XLS file attached that includes the macro working for July 2006 (and I recorded the macro according to it) and June 2005. There will be 4 sheets, the first and the third sheets ("07_2006_BF" and (06_2005_BF") are the data before the macro while the second and the fourth sheets ("07_2006_AF" and "06_2005_AF") are the data after applying the macro. Also you will see a TXT file attached that includes the macro I recorded. Will you gonna edit the macros so they will stop working when they face an empty cell or you will make a new macro to delete the extra rows? And another thing, when I apply "macro2" a message appears to confirm pasting the cells over the existing cells and I should hit OK, how can I edit the macro so it will hit OK instead of me?
Many thanks Bjorn for your GREAT effort with me, you really saved a lot of my time.
Attached Files
File Type: xls Weather_Forum.xls (261.5 KB, 17 views)
File Type: txt macro_Forum.txt (11.3 KB, 12 views)

Last edited by tareq; 01-26-2011 at 01:42 PM.
Reply With Quote