Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Days 360

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian A - 07 Mar 2008 19:30 GMT
I recorded a macro which sorts a column of dates selects the first date and
the end date and runs the Days360 excel function and divides that by 7 to get
the number fo weeks. I am trying to modify this macro because when I recorded
the macro it selected the exact cell of that particular data set. However,
each data set may have a different cell as the second date. So now I have
figured out how to select the last cell but I cant firgure out how to put
this in my Days360 function. I have pasted my code below. This code is giving
me an error. Plus it needs to be cleaned up because I have alot of useless
mouse clicks.

Rows("1:1").Select
   Selection.Insert Shift:=xlDown
   Selection.Delete Shift:=xlUp
   Cells.Select
   Selection.Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlGuess, _
       OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
       DataOption1:=xlSortNormal
   Rows("1:1").Select
   Selection.Insert Shift:=xlDown
   Range("F1").Select
   ActiveCell.FormulaR1C1 = Application.Days360(Range(ActiveCell,
ActiveCell.End(xlDown)).Select) / 7
   Range("F1").Select
   Selection.NumberFormat = "0"
   ActiveWorkbook.Save
Graham Mayor - 08 Mar 2008 14:21 GMT
You might do better asking Excel questions in an Excel forum - this one is
for Word.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I recorded a macro which sorts a column of dates selects the first
> date and the end date and runs the Days360 excel function and divides
[quoted text clipped - 22 lines]
>    Selection.NumberFormat = "0"
>    ActiveWorkbook.Save

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.