Click here to Skip to main content
15,922,407 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Multiple lines in input boxes Pin
Klaus Probst7-Aug-01 15:54
Klaus Probst7-Aug-01 15:54 
GeneralCapture the key hit Pin
An16-Jun-01 8:21
An16-Jun-01 8:21 
GeneralRe: Capture the key hit Pin
17-Jun-01 22:19
suss17-Jun-01 22:19 
GeneralRe: Capture the key hit Pin
19-Jun-01 15:07
suss19-Jun-01 15:07 
GeneralRe: Capture the key hit Pin
7-Jul-01 20:41
suss7-Jul-01 20:41 
GeneralOutlook VB script: Print Method Pin
15-Jun-01 5:21
suss15-Jun-01 5:21 
GeneralActiveX control for the web Pin
15-Jun-01 4:45
suss15-Jun-01 4:45 
GeneralDates and period in between (Excel VBA) Pin
Ian14-Jun-01 23:17
Ian14-Jun-01 23:17 
Can anyone tell me how I can use vba to claculate the number of weeks between two dates please?

I have an excel spreadsheet where the user is prompted to enter a start date and an end date via two input boxes:

duedate = Application.InputBox(Prompt:="Enter first charge date This must be a Monday's date", Default:="02-04-01:", Type:=0)

todate = Application.InputBox(Prompt:="Enter last charge date if different from end of year ", Default:="25-03-01:", Type:=0)


What I would like is to be able to return the number of weeks to another variable say called mult. Then to use this multiplier in a further function.
To complicate matters further I then need to calculate how many of a particular day of a month are in each of the months between the two dates. The day of the month is also requested via an input box as above and held in the variable daymon
To complicate it even further I somehow need to restrict the entries in the first two input boxes to be dates and to be Monday's.

This is so I can create a spreadsheet that tells calculates a weekly charge and then makes it into a monthly payment schedule.

Thanks in advance

Ian
Confused | :confused:
GeneralRe: Dates and period in between (Excel VBA) Pin
Ian15-Jun-01 5:07
Ian15-Jun-01 5:07 
GeneralRe: Dates and period in between (Excel VBA) Pin
AndyG15-Jun-01 11:05
AndyG15-Jun-01 11:05 
GeneralRe: Dates and period in between (Excel VBA) Pin
Ian15-Jun-01 21:29
Ian15-Jun-01 21:29 
GeneralRe: Dates and period in between (Excel VBA) Pin
Ian17-Jun-01 22:34
Ian17-Jun-01 22:34 
Generalplease help Pin
Rodney14-Jun-01 20:39
Rodney14-Jun-01 20:39 
Generalinput validation Pin
Ian11-Jun-01 2:37
Ian11-Jun-01 2:37 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 3:09
Michael P Butler11-Jun-01 3:09 
GeneralRe: input validation Pin
Ian11-Jun-01 4:16
Ian11-Jun-01 4:16 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 5:00
Michael P Butler11-Jun-01 5:00 
GeneralRe: input validation Pin
Ian11-Jun-01 5:36
Ian11-Jun-01 5:36 
GeneralRe: input validation Pin
Ian11-Jun-01 5:59
Ian11-Jun-01 5:59 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 8:48
Michael P Butler11-Jun-01 8:48 
GeneralRe: input validation Pin
Ian11-Jun-01 20:31
Ian11-Jun-01 20:31 
GeneralMicrosoft Outlook 2000 Pin
Mahesh Sundararaman10-Jun-01 23:49
Mahesh Sundararaman10-Jun-01 23:49 
Generalexcel vba Pin
Ian10-Jun-01 8:36
Ian10-Jun-01 8:36 
GeneralRe: excel vba Pin
Giles10-Jun-01 8:51
Giles10-Jun-01 8:51 
GeneralRe: excel vba Pin
Ian10-Jun-01 20:13
Ian10-Jun-01 20:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.