Hi guys/gals,
On clicking a command button, a user is prompted to insert todays date. The VBA for this is as follows:-
Dim Message, Title, Default, MyValue
Message = "Input Yesterday's Date in ddmmyy format" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "dd/mm/yy" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
I then use MyValue to open up a workbook which is say "C:\sales " & MyValue & ".xls" which works fine.
I would also like to open up the previous days sales figures. I was hoping to use Myvalue - 1 but this does not appear to work.
Ideally .... as sales will only be Monday to Friday ..... I would also like the VBA to distinguish that if Myvalue is a monday, then the previous day I need is te Friday ... i.e. Myvalue - 3 as opposed to Myvalue - 1
On clicking a command button, a user is prompted to insert todays date. The VBA for this is as follows:-
Dim Message, Title, Default, MyValue
Message = "Input Yesterday's Date in ddmmyy format" ' Set prompt.
Title = "InputBox Demo" ' Set title.
Default = "dd/mm/yy" ' Set default.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)
I then use MyValue to open up a workbook which is say "C:\sales " & MyValue & ".xls" which works fine.
I would also like to open up the previous days sales figures. I was hoping to use Myvalue - 1 but this does not appear to work.
Ideally .... as sales will only be Monday to Friday ..... I would also like the VBA to distinguish that if Myvalue is a monday, then the previous day I need is te Friday ... i.e. Myvalue - 3 as opposed to Myvalue - 1