Excel VBA Introduction Part 11.1 - Input Boxes

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

Комментарии • 63

  • @maurocastagnera8949
    @maurocastagnera8949 7 лет назад +31

    InputBox "is Andrew Gould the best VBA teacher on internet?"
    Absolutely yes! No other answer is allowed, otherwise "runtime error"!

  • @rameshkumarb6479
    @rameshkumarb6479 5 лет назад +1

    thank you andrew gould ....i searched lots of videos in youtube for input box and data types ....yours is the most helpful video.......

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад

      You're very welcome, Ramesh, thank you for watching!

  • @nehemiahpraveen12
    @nehemiahpraveen12 9 лет назад +1

    I want to tell u that, I am a beginner in programming. But I am becoming an expert little by little by your videos. May god bless u.

  • @maurocastagnera8949
    @maurocastagnera8949 7 лет назад

    Dear Andrew,
    I'm sorry I can not understand everything you teach with these videos because I do not understand English perfectly (I'm still perfecting it) but I assure you never met a good teacher like you, so simple to explain and also clear conceptions at first glance are very complex. Anyway, as far as I understand in English, your videos have helped me a lot and certainly a little at a time I will be able to understand even the toughest things.
    This is thanks to you that you are a person who can convey the joy and the taste of learning, even for simple personal culture and this is a very important quality that only the great teachers have.
    I'm really grateful to you.
    A warm greeting from Italy.

  • @GaganDeep-mj5hi
    @GaganDeep-mj5hi 3 года назад +2

    Best channel to learn VBA. Great Job..

  • @kelvinwu1476
    @kelvinwu1476 7 лет назад

    I just want to say that your video is really awesome and I have not seen anyone so patient about answering questions in the comments

  • @ashrafkhan8025
    @ashrafkhan8025 8 лет назад +1

    Thank YOU !! Your videos have really helped me a lot and made me more efficient than Before.
    Because of the your lessons , i have been receiving lot of accolades in my workplace.
    Thank You Andy :)

  • @KM-co5mx
    @KM-co5mx 2 года назад +1

    Thank You for explaining why we get those syntax errors!
    I always wondered the why and why not.

  • @derrickcohen4398
    @derrickcohen4398 9 лет назад

    Thank you for sharing such a structured, insightful, informative and detailed lecture. Your videos surpass many of the courses I've taken online and at my local college. Books are great and I truly cherish them but there is nothing like having someone who is knowledgeable and incorporates that knowledge with experience and insight which adds to the learning experience. In the working place it is said knowledge should be shared while ignoring it is really sold. Thank you for sharing.

  • @mattiaguerini1458
    @mattiaguerini1458 6 лет назад

    I would thank you for all. I hope you see my comment because I've learned a lot of stuff seeing your videos. Thanks thanks thanks ❤

  • @ianmurphy902
    @ianmurphy902 10 лет назад

    Thanks wise owl will give both a go.
    Looking forward to seeing your videos on userform.

  • @crashthestash
    @crashthestash 8 лет назад +19

    So did you ever get around to seeing Gravity?

  • @sirsuraj81
    @sirsuraj81 9 лет назад +2

    These are awesome. Thank you so much

  • @PADRONJORGEL
    @PADRONJORGEL 7 лет назад

    Hello again... it's getting interesting...

  • @anthonyaguirre6101
    @anthonyaguirre6101 7 лет назад

    Many thanks! Great video.

  • @stoyanpetkov182
    @stoyanpetkov182 6 лет назад +2

    This is awesome training. I like it a lot. Regarding this part there is still a problem if one enters invalid input for "release date" (I liked the example "elephant"). At the sentence for conversion (CDate) will appear mismatch error. Is there a way of getting around this?

  • @ankitagoel2098
    @ankitagoel2098 7 лет назад

    Your videos are really helpful & interesting :)

  • @MegaMalzer
    @MegaMalzer 10 лет назад

    These videos are a hoot! But is there any way to download the tutorial workbooks to help follow along? Some of the worksheets are tedious to duplicate.

  • @PraveshKothari91
    @PraveshKothari91 9 лет назад

    Great Videos! Thank You

  • @matthoward123
    @matthoward123 8 лет назад

    Outstanding video series. In this one, we see how to handle a blank date. What about an invalid date? For example 31 Feb 2013, which would still currently lead to a run-time error? Is there a way to check for valid date before performing the conversion?

  • @ianmurphy902
    @ianmurphy902 10 лет назад

    Great videos learning a lot expanding my knowledge of vba.
    Do you have videos showing how to calculate multiple cells or string together array formulas

    • @ianmurphy902
      @ianmurphy902 10 лет назад

      If I had a formula
      =(a2+a3)*(b2+b3)\(c2+c3))+b3
      Then put answer in range("d3").value.
      Or something along those lines.

  • @aquabestindian
    @aquabestindian 9 лет назад

    Thanks for this video... :)
    My question is, what if someone enters some random letters in date, say "ab"?
    How to handle the run-time error in that case??

  • @anthonyayres6939
    @anthonyayres6939 8 лет назад

    +WiseOwlTutorials Your videos are great. However, I continue to get an error with this line - Range("B7").End(xlDown).Offset(1,0).Select - I have tried this formula in many different ways and all of those seem to work. Ex: Range("B7").End(xlUp).Offset(1,0).Select , Range("B7").End(xlDown).Select just to name a few. Any ideas why? Thanks for making these videos and hope to learn more as I continue to watch the series.

  • @rohansharma8157
    @rohansharma8157 10 лет назад

    I have some questions on input boxes. How would I use the input box to store a value to a variable such as a number (such as double), but at the same time prevent the program from crashing by using the variant data type for the variable? It always ends up saving as a string, and then why I try to compare the number to other numbers to check if they are greater or less than, the program doesn't work properly because the initial input was saved as a string.
    Second, how do you prevent the error screen from popping up if the user doesn't enter a valid response into the input box?
    Thanks!

  • @MrSaemichlaus
    @MrSaemichlaus 6 лет назад

    So if you typed in "Elephant" for the date in the last version of your script, the if condition would pass the (non-empty) input as valid and the CDate function would throw the type error again. What you're testing is just whether anything was typed in at all (not making a difference between the user pressing [Ok] with an empty input or the user pressing [Cancel] either). How would you check for an invalid type entry?

  • @igorsacer8359
    @igorsacer8359 9 лет назад +1

    Thank You!

  • @Magdoulin
    @Magdoulin 3 года назад

    But do I really need this line?
    YourAgeErrorHandler = CDate(YourAge)
    I mean, YourAgeErrorHandler passed the error handling and it contain now a valid date, so, the implicit data conversion should do the job at this stage, right?

  • @TheFikaky
    @TheFikaky 9 лет назад

    Please, can you please tell me weather it would be possible to change inputbox background color (not text input field, but entire input box), and what would be the code for that, thanks

    • @TheFikaky
      @TheFikaky 9 лет назад

      Thank you for replying promptly..I have already watched the userform video..have to say that your videos are very practical and useful, would recommend them to anyone trying to learn VBA! very nice

  • @veereshsurasetty8216
    @veereshsurasetty8216 9 лет назад

    ***** Hi Andrew, First I should tell that your videos are very good, you explain very clearly. Thanks a lot for this. I have a question, how can I have multiple Input Box. Let's say that my Input box should allow user to type in as many names he wants and it should capture those results in that many rows.

  • @kmanrajan
    @kmanrajan 7 лет назад

    Thank you very much

  • @peterhontaru5537
    @peterhontaru5537 6 лет назад

    Brilliant

  • @xiaowenchen9605
    @xiaowenchen9605 7 лет назад

    I have tried typing those VBA codes exactly as your video shows, those 3 input box did show up(asking film name, release date and film length). However, what finally shows on my spreadsheet are three variables, which are" 5/29/1900", separately on cell B16, B17 and cell B18. I couldn't see the film name or release date. Do you know why?

  • @alcapone1366
    @alcapone1366 8 лет назад

    hi, Question:
    what if you only have first row like Name, and Date and want to create the whole list from zero.
    the Range("A1").End(xlDown).Offset(1, 0) = "variable" where variable defined by user like "david" for name
    gives me runtime error 1004.
    how can we solve this?
    Thnx

  • @FRANKWHITE1996
    @FRANKWHITE1996 8 лет назад

    thank you

  • @funsizes
    @funsizes 9 лет назад

    Hey Andrew,
    Do you have these lectures in powerpoint format?

  • @zamanmaharramov7665
    @zamanmaharramov7665 7 лет назад

    great. thank you

  • @HaarisAliBA
    @HaarisAliBA 9 лет назад

    Hi Andrew, thank you for the great lectures, i am finding them really useful. I have a question. I am using an input box to enter cost of an item and have declared Cost variable as data type currency. If i enter something else other than a number or currency i get type mismatch error, how can i change this to get a message that the user has entered incorrect data type. Here is what i have done
    Dim Cost as Currency
    Cost = InputBox("Enter cost")
    If Not IsNumeric(Cost) Then
    MsgBox "Incorrect data type", vbRetryCancel
    End if
    Regards,
    Haaris

    • @HaarisAliBA
      @HaarisAliBA 9 лет назад

      ***** Hi Andrew, thank you for your response. I figured out the solution after i watched lecture 11a.
      Thank you.

  • @Jeedxx
    @Jeedxx 6 лет назад

    So I was confused for a while because my data on cell B3 keeps getting replaced whenever I input a new one using an inputbox. Turns out that I need to have a set of data first encoded then the future data eg cell B4 can be input using the inputbox.

  • @torque6389
    @torque6389 6 лет назад

    Great job! Thank you so much for these wonderful videos!

  • @prashantdubey481
    @prashantdubey481 6 лет назад

    Sir..I have one doubt...if i enter some text in strfilmdate then it won't be able to convert it in a date and still will give me Type Mismatch Error. Any solutions for this please?

  • @maurocastagnera8949
    @maurocastagnera8949 7 лет назад

    Thank you very much for your videos. Unfortunately J don't understand all because your language is different from mine. J tried with youtube subtitles translate but It wasn't good. Do you Know an orher way to translate your videos in Italian language? Thanks in advance!

    • @maurocastagnera8949
      @maurocastagnera8949 7 лет назад

      Thanks a lot for your answer. J setted youtube video speed so J can ear your voice more slowly. In this way J can improve my English too not learn VBA only. Thank you very much and J repeat that your videos are the best J've ever seen on internet! Congratulations!

  • @irynamusiiovska828
    @irynamusiiovska828 6 лет назад

    thanks

  • @minah387
    @minah387 10 лет назад

    Brilliant as always!!, TBH I never knew about the "InputBox", I always use the "Application.InputBox" instead, as it allows specifying the type of input being String, Number, Range, etc.,
    Although it doesn't have a Date type, I would use a "0" for the If statement and it usually does the trick. Do you know of any benefits for the InputBox over the Application.InputBox?
    Ex:
    Sub InputDate()
    Dim UserDate As Date
    UserDate = Application.InputBox("test", Type:=1)
    If UserDate = 0 Then
    MsgBox "No date entered"
    Else
    MsgBox "date entered is " & UserDate
    End If
    End Sub

    • @minah387
      @minah387 10 лет назад

      ***** That's an honour coming from you, but I'm not the tutoring type, I'm more of a "trial and error" kinda guy :D, you on the other hand seem to know exactly what you're talking about .. keep it up!

  • @SantoshLoka
    @SantoshLoka 7 лет назад

    At 8:51: im not getting Hello (my name) going directly MsgBox "You Didn't enter a Name", vbExclamation
    How can i get Hello ANDY

  • @jayjayf9699
    @jayjayf9699 5 лет назад

    What if you entered a string which can’t be converted into a date , for example “hdjdhd” how would you validate that doesn’t happen ?

    • @WiseOwlTutorials
      @WiseOwlTutorials  5 лет назад

      Hi Jay, I'd capture the result as a string and then use the IsDate function to test whether the input is a date or not. The very basic code would look something like this:
      Sub CaptureDate()
      Dim StringDate As String
      Dim DateDate As Date
      StringDate = InputBox("Enter a date")
      If Not IsDate(StringDate) Then
      MsgBox "That's not a date"
      Exit Sub
      End If
      DateDate = StringDate
      'do other stuff
      End Sub
      Hope it helps!

  • @behrawarkhan
    @behrawarkhan 9 лет назад

    i get this error whenever i run the film input boxes
    runtime error 1004
    Application-defined or operation-defined error.

  • @rubenbolink759
    @rubenbolink759 8 лет назад +1

    Range("B1").End(xlDown).Offset(1, 0).Select I am getting an error with the code above.What is wrong? its the same as in the video.

  • @marcip1456
    @marcip1456 7 лет назад

    It really stresses me out that you keep adding a movie with a release date of 2013 to your list of Highest grossing films of 2012. :) Great videos, though!

  • @tasoskatsikoagiannis3564
    @tasoskatsikoagiannis3564 7 лет назад

    Despite I like your videos. I disliked that as you don't explain all the parameters. When you say MsgBox or InputBox please focus on the directly linked parameters first

  • @b.petrushchak
    @b.petrushchak 9 лет назад

    Thank you!

  • @dbascb
    @dbascb 10 лет назад

    Thank you!