F
Francis Hookham
An InputBox prob
The ³Insert a Row using a Macro to maintain formulas² from
http://www.mvps.org/dmcritchie/excel/insrtrow.htm
was great but now I am in another muddle!
I should like to follow that with an Input box which carries the date from
the cell in column 3 in the original row as the Input box Default so it can
be used again or over written if I choose. Bearing in mind that most (but
not all) dates are this year then I would normally only enter ³d/m² rather
than ³d/m/y² when last year
(I should prefer a ³UserForm² containing other entries - Item, Code as a
dropdown box, amount to be placed in other cells, but that is a different
ball-park and I have not ventured into UserForms since the days of Dialog
Boxes - was that what they were called?
I am not at all clear about the format of the date - as text, as a number of
days entered into a formatted cell - there is no need to calculate anything
using dates so text will be ok
This is as far as I have got and it does not work - can you help please?
If DatePaid = False Then
DatePaid = Application.InputBox(prompt:= _
"What was the payment date?", Title:="DatePaid", _
Default:="Input date")
DatePaid = Format(DatePaid, "d/m/yy")
Else
DatePaid = Application.InputBox(prompt:= _
"What was the payment date?", Title:="DatePaid", _
Default:=DatePaid)
End If
Cells(RowNumber, 3).FormulaR1C1 = DatePaid
I put in the If DatePaid thinking that, at start-up DatePaid (Dim DatePaid
As String or Dim DatePaid As Date) would be empty whereas, once the
programme was open and the macro run for the first time the previous date
would be stored in the DatePaid
Thanks again for this wonderful service
Francis Hookham
The ³Insert a Row using a Macro to maintain formulas² from
http://www.mvps.org/dmcritchie/excel/insrtrow.htm
was great but now I am in another muddle!
I should like to follow that with an Input box which carries the date from
the cell in column 3 in the original row as the Input box Default so it can
be used again or over written if I choose. Bearing in mind that most (but
not all) dates are this year then I would normally only enter ³d/m² rather
than ³d/m/y² when last year
(I should prefer a ³UserForm² containing other entries - Item, Code as a
dropdown box, amount to be placed in other cells, but that is a different
ball-park and I have not ventured into UserForms since the days of Dialog
Boxes - was that what they were called?
I am not at all clear about the format of the date - as text, as a number of
days entered into a formatted cell - there is no need to calculate anything
using dates so text will be ok
This is as far as I have got and it does not work - can you help please?
If DatePaid = False Then
DatePaid = Application.InputBox(prompt:= _
"What was the payment date?", Title:="DatePaid", _
Default:="Input date")
DatePaid = Format(DatePaid, "d/m/yy")
Else
DatePaid = Application.InputBox(prompt:= _
"What was the payment date?", Title:="DatePaid", _
Default:=DatePaid)
End If
Cells(RowNumber, 3).FormulaR1C1 = DatePaid
I put in the If DatePaid thinking that, at start-up DatePaid (Dim DatePaid
As String or Dim DatePaid As Date) would be empty whereas, once the
programme was open and the macro run for the first time the previous date
would be stored in the DatePaid
Thanks again for this wonderful service
Francis Hookham