View Poll Results: What should i do?

Voters
1. This poll is closed
  • stop project until i get better

    1 100.00%
  • wait

    0 0%
  • use a totally different macro

    0 0%
  • don't do it ever again

    0 0%
+ Reply to Thread
Results 1 to 12 of 12

I need to use InputBox function

  1. #1
    Forum Contributor
    Join Date
    08-22-2012
    Location
    nj, us
    MS-Off Ver
    Excel 2010
    Posts
    163

    Angry I need to use InputBox function

    Help!
    i need to make an input box using coding that asks for two numbers and subtracts the first num from the second one
    then, i need a msgbox that shows the answer

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: I need to use InputBox function

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: I need to use InputBox function

    How about:
    Please Login or Register  to view this content.
    Gary's Student

  4. #4
    Forum Contributor
    Join Date
    08-22-2012
    Location
    nj, us
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: I need to use InputBox function

    jakobshavn, u didn't define N1 or N2
    Bob, there is an error when i run it ( compile error)

  5. #5
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: I need to use InputBox function

    You are correct! The macro should run without the definitions.

  6. #6
    Forum Contributor
    Join Date
    08-22-2012
    Location
    nj, us
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: I need to use InputBox function

    Jakob, u didn't define N1 or N2 so there is an error

  7. #7
    Forum Contributor
    Join Date
    08-22-2012
    Location
    nj, us
    MS-Off Ver
    Excel 2010
    Posts
    163

    Angry Re: I need to use InputBox function

    is N1 an integer,string etc.?

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: I need to use InputBox function

    Dim them as Variants

  9. #9
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: I need to use InputBox function

    When you respond, touch Go Advanced at the bottom and use the paperclip.

  10. #10
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: I need to use InputBox function

    I've redone Jakobshavn's code a bit
    Please Login or Register  to view this content.
    There should be no errors now with Option Explicit on.

    ---------- Post added at 02:41 PM ---------- Previous post was at 02:39 PM ----------

    Quote Originally Posted by john456852 View Post
    Bob, there is an error when i run it ( compile error)
    I just ran Bob's code and didn't receive any errors. What was the description of the error thrown?
    Last edited by Mordred; 08-22-2012 at 04:45 PM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  11. #11
    Forum Contributor
    Join Date
    08-22-2012
    Location
    nj, us
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: I need to use InputBox function

    Use the marine macro not the inputbox macro

    ---------- Post added at 04:26 PM ---------- Previous post was at 04:25 PM ----------

    N1 and N2 weren't defined yet

    ---------- Post added at 04:27 PM ---------- Previous post was at 04:26 PM ----------

    Don't change the project unless u can improve it

  12. #12
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: I need to use InputBox function

    I can't say that I understand your post 13! Did you try the amended code that I did? With Bob's, did you copy and paste it into your workbook because the code you have in there is not the same?!?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1