nikolaikolev
New Member
- Joined
- Nov 22, 2011
- Messages
- 24
Dear,
i have a VBA UserForm with textbox "check in date" (format: DD.MM.YYYY) and textbox "check out date" (format: DD.MM.YYYY).
I want in the next textbox "number of nights" vba to auto calculate the number of night between "check in" and "check out" dates.
I use the folowing code but for som reason it is not working.
Any help appreciated.
Dim Nights As Integer
On Error Resume Next
Nights= Nights + CDbl(CheckOut.Value)
Nights= Nights- CDbl(CheckIn.Value)
Nights.Caption = Nights
i have a VBA UserForm with textbox "check in date" (format: DD.MM.YYYY) and textbox "check out date" (format: DD.MM.YYYY).
I want in the next textbox "number of nights" vba to auto calculate the number of night between "check in" and "check out" dates.
I use the folowing code but for som reason it is not working.
Any help appreciated.
Dim Nights As Integer
On Error Resume Next
Nights= Nights + CDbl(CheckOut.Value)
Nights= Nights- CDbl(CheckIn.Value)
Nights.Caption = Nights