ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Form question (https://www.excelbanter.com/excel-programming/368575-user-form-question.html)

TimN

User Form question
 
I have a user form that askes for the user to enter a date. That date then
goes to a cell on the spreadsheet.

If the user skips over that date, I would like for the cell that normally
would contain the date to say "Not Yet Approved". That is probably some
if-then statement, but I can't seem to figure out the right combination. Any
ideas?

Thanks.

Dave Peterson

User Form question
 
if isdate(me.textbox1.value) then
worksheets("somesheet").range("a1").value = cdate(me.textbox1.value)
else
worksheets("somesheet").range("a1").value = "not yet approved"
end if

Maybe in the ok button code?


TimN wrote:

I have a user form that askes for the user to enter a date. That date then
goes to a cell on the spreadsheet.

If the user skips over that date, I would like for the cell that normally
would contain the date to say "Not Yet Approved". That is probably some
if-then statement, but I can't seem to figure out the right combination. Any
ideas?

Thanks.


--

Dave Peterson

TimN

User Form question
 
That is so cool!!!! Thanks!!!


"Dave Peterson" wrote:

if isdate(me.textbox1.value) then
worksheets("somesheet").range("a1").value = cdate(me.textbox1.value)
else
worksheets("somesheet").range("a1").value = "not yet approved"
end if

Maybe in the ok button code?


TimN wrote:

I have a user form that askes for the user to enter a date. That date then
goes to a cell on the spreadsheet.

If the user skips over that date, I would like for the cell that normally
would contain the date to say "Not Yet Approved". That is probably some
if-then statement, but I can't seem to figure out the right combination. Any
ideas?

Thanks.


--

Dave Peterson



All times are GMT +1. The time now is 10:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com