debug error with CDate function in empty textbox

ohexcell_ineedu

New Member
Joined
Jan 28, 2012
Messages
47
Hey guys,

I am trying to create a form that the user keys in the date in the format dd/mm/yyyy, and it then gets pasted into a cell. Sometimes though there isn't always a need to fill in the textbox with a date, and that produces an error (because there are no values there that are a date).

You can download my sample worksheet from here - https://dl.dropboxusercontent.com/u/9154762/Book1.xlsm

Just open up the user form then don't key in any values to repeat the error.

Any help will be appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Just test the textbox first:
Code:
If IsDate(Textbox.text) then activecell.value = CDate(textbox.text)
for example.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,659
Members
449,462
Latest member
Chislobog

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top