Excel VBA InputBox Cancel - Code Included

Excel VBA InputBox Cancel - Code Included

EverydayVBA

7 лет назад

15,936 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Moises Tatis
Moises Tatis - 09.07.2023 03:01

Excellent video, thanks for making it. Simple but very helpful!

Ответить
floscar
floscar - 17.01.2023 00:12

Thanks for the help, I found that a Do Loop works great even in handling a Cancel
input=inputbox "Enter Somthing"
Do while input =""
input=inputbox "Enter Something"

Loop

Ответить
Manish Reddy
Manish Reddy - 24.03.2022 10:01

Whatif my inputbox is of type integer this isn't working

Ответить
缺口
缺口 - 26.06.2021 02:38

but it doesn't work when the inputbox type is 8.

Ответить
Henrique Eglem
Henrique Eglem - 15.03.2021 22:21

Great Video! Very concise .....Congrats

Ответить
Wovi10
Wovi10 - 13.06.2019 14:32

Maybe try to speak to the lens in stead of the screen next to the lens. (You could try to just turn around that screen)

Ответить
gelucu
gelucu - 29.05.2019 15:43

Hello. I have written this code as a part of a larger code


Dim myData1 As Date

myData1 = InputBox("Introduceti data alimentarii / in format LUNA-ZI", "DATA ALIMENTARE", Date)
ActiveCell.Value = myData1




This code brings to a specified cell the value from InputBox (myData1).


Now i tried to activate the cancel button in the way you have presented in the video but unfortunately I did`t succeed. After I tried the code from you I have written this code by my own but still generate bugs.


Dim myData1 As Date

myData1 = InputBox("Introduceti data alimentarii / in format LUNA-ZI", "DATA ALIMENTARE", Date)

If myData1 = "" Then
Exit Sub
Else
ActiveCell.Value = myData1
End If






If you can help me with this problem will be great. Thank you.

Ответить
coolag74
coolag74 - 26.04.2019 19:27

I have data in a sheet 1 under these headings. No., Name, Address, Mobile, Class, Section and so on...
I created a button for "Search". When I click this button it asks through input box "Enter a number", when I enter a number it will search from that sheet and give the result in sheet 2. I use sheet 2 as a user form and these data will come in the specified cells. Like I want No. in A1, Name in B2, Mobile in B4, Class in C2, Section in C3 and so on...
How can I write the code for the input box to search the result from sheet 1 and give the result in sheet 2...

Ответить
Info-learn-DZ
Info-learn-DZ - 09.05.2017 18:37

thx you helped me

Ответить