Тёмный

Excel VBA Input Box for Dates - Code Included 

EverydayVBA
Подписаться 11 тыс.
Просмотров 30 тыс.
50% 1

Grab the Free VBA Quick Reference Guide
chrisjterrell....
In this Video we use use the input box to collect a date and validate that a date is entered
Code
Sub InputboxStuff()
Dim dte As Date
mbox = InputBox("Enter a date", "Dates are cool")
If IsDate(mbox) Then
dte = CDate(mbox)
Range("C9") = dte
Else
MsgBox "This isn't a date. Try Again"
End If
End Sub

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@CoCo-Vitamin
@CoCo-Vitamin 2 года назад
Thank you so much for your help!
@KnowEverythin
@KnowEverythin 5 лет назад
Sir, if i text box2 input time is less then input textbox1, then give error msg in excel... exm textbox1= 00:20, textbox2=23:30... then give error msg .
@karitapirhonen5431
@karitapirhonen5431 Год назад
Waht about eidting tables by loking the date column or deleting data by looking the date column?
@dasindira
@dasindira 5 лет назад
Hi! Can you please help me with this date issue i have? i have 2 cells where dates are entered ...lets say cell B4 and cell C4. B4 is manufacturing date and C4 is expiry date. I need to check through a code that C4 is not equal to today, C4 is greater than today and B4. B4 is not equal to today, and B4 is less than today. Can you please help me with the code. i am very new to VBA excel coding. I am using Excel 2016, 32 bit version.
@EverydayVBAExcelTraining
@EverydayVBAExcelTraining 5 лет назад
Could you use a formula? It would be kind of like the example below =if(c4today(), "if true", " if false")
@nhielapostol2936
@nhielapostol2936 4 года назад
hi sir. i wanna ask if you can give us an input box to filter specific date? hope you can. thank you
@EverydayVBAExcelTraining
@EverydayVBAExcelTraining 4 года назад
There is a calendar activex control that you can use. Although it might be on the older versions of excel. They have been trimming back their code over time. I haven't used it in a long time.
@kaaa3485
@kaaa3485 5 лет назад
Great Video!!!. I have many ranges in a form. i want to color the cell to show that are required. if the cell has data, no color but if the cell is blank, color the cell. Also, I want to format a number to a date (like access)? if I enter a number 121519, it will give me 12/15/19 or If I enter 12/15/19 it will give me the same things.. Thanks in advance.
@gabrieldionisierotar4815
@gabrieldionisierotar4815 3 года назад
I need your help again: how should I proceed to substitute the Date with a custom number on format "##.##", to be inserted like "12.45"? Thanx!
@EverydayVBAExcelTraining
@EverydayVBAExcelTraining 3 года назад
You will need to use format in the cell or range
@JosephArouna
@JosephArouna 6 лет назад
Obviously you are not a teacher. Please do improve your method of teaching. Be more organized in presenting tutorials. Thanks for taking into account my opinion.
@EverydayVBAExcelTraining
@EverydayVBAExcelTraining 6 лет назад
+Joseph Harouna Yaya appreciate the feedback and yes some of my videos are not the best
@hubertg7100
@hubertg7100 5 лет назад
I think his videos is geared more for advance excel user who is looking for a reference. I pick it up rght away . The positive side is that the vid is short and to the point. It's hard to find that you tube nowadays.
@EverydayVBAExcelTraining
@EverydayVBAExcelTraining 5 лет назад
Appreciate the comment
@cdorman11
@cdorman11 3 года назад
I'm not sure what your gripe is, since you were less than clear in your post. Perhaps what you meant to say is that it was not explicated that there is no date data type for inputs, thus forcing the input to be a string. Knowing that would make clear why he doesn't immediately assign the input to a date variable.
@incredible421
@incredible421 8 лет назад
Do VBA supports British date format? or is it US format only
@EverydayVBAExcelTraining
@EverydayVBAExcelTraining 8 лет назад
I don't think it does... I would recommend you use the Format Function to convert the British Format to the US format. You could also write a function that did that for you. That is kind of a pain
@savann.sun1980
@savann.sun1980 Год назад
Im not sure why I came here.
Далее
Date controlling combobox Excel VBA
7:44
Просмотров 15 тыс.
Китайка стучится Домой😂😆
00:18
🛑самое главное в жизни!
00:11
Просмотров 256 тыс.
Automate Date Validation Using VBA
11:38
Просмотров 7 тыс.
Textbox Format Excell VBA
9:54
Просмотров 62 тыс.
Format dates with VBA
7:28
Просмотров 37 тыс.
Excel VBA Calculations in a Userform
14:43
Просмотров 105 тыс.
Китайка стучится Домой😂😆
00:18