+ Reply to Thread
Results 1 to 19 of 19

Stupid Input Box Error 2015

  1. #1
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Stupid Input Box Error 2015

    Hey Guys ! The code is so simple (I thought...) but it isn't even displaying the input box, and I've never encountered that. I have some code before the issue to give some variables names:
    Please Login or Register  to view this content.
    and then that works fine, but when I try to use:


    Please Login or Register  to view this content.
    It doesn't display the box and just says that Prelimorfinal = "Error 2015" I'm still really new to this stuff and I thought I would try to break down the code into multiple lines so it's prettier and I undid that as an experiment but that doesn't appear to be the problem.

    I'm pretty sure I made a dumb error. But I've tried Googling this and I just have no idea what went wrong.

    (The code is posted virtually in entirety, I omitted a line that checks for worksheets.count = 6 at the very top, and I split it up because I'm trying to identify that the top portion works fine and the problem is 'only' in the bottom portion)

  2. #2
    Registered User
    Join Date
    07-16-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Stupid Input Box Error 2015

    i've just tested that code for the input box on my pc and it seems to work fine, could you post the full code maybe?

    Andy

  3. #3
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    I hate my life. I mean, that like, is practically the full code. Lol. Here:

    Please Login or Register  to view this content.
    I'm still writing code so technically the code changes every minute. :P -- oh and I don't anticipate the lower sections working yet, I didn't get a chance to debug them. So please nobody bother correcting that stuff, I probably will be able to. It's just the not-appearing input box that is halting my correction process
    Last edited by tomn13; 11-02-2012 at 12:41 PM. Reason: modified last sentence

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Stupid Input Box Error 2015

    okay, for me once i got the code to run (had to change some missing goto lines, but i assumed theyre all fine for you) then the code seemed to run fine. although i got errors on ActiveWorkbook.Worksheets(prelimorfinal).Range("A1").Select where it wouldn't select the cell withotu activating the sheet first (but i didnt think that should be a problem, i miust admit my excel does seem to be playing up a little bit.)

    Either way that input box SHOULD work, doesnt seem to be anything wrong with the code.

    Have you tried stepping into the code and running it line by line?

    Andy

  5. #5
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    Ahh sorry about the goto lines. I'm still learning fourm etiquette. I probably need to suck it up and actually post the whole POS -- I just feel bad about posting entire streams of code. I code so poorly that things are usually 10x the length they need to be. So I omitted my "error box" which is where those goto's point. I'm really ghetto. And I think people will laugh at my "error box"

    Ok I copied JUST the input box to a new module and took out all other code and it works. It must be a problem with my use of the variables once they were given values...

  6. #6
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    I just confirmed the problem is with the inclusion of

    Please Login or Register  to view this content.
    ... I just want to list the worksheet names in my dialogue box, any ideas on how to do that?

    OK I've clearly identified it as a problem with 'list separators' :

    Please Login or Register  to view this content.
    -- the way the &'s are used with trying to include the defined worksheet name
    Last edited by tomn13; 11-02-2012 at 12:57 PM.

  7. #7
    Registered User
    Join Date
    07-16-2012
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Stupid Input Box Error 2015

    That code works for me also, is there anything with any of your sheet names that could cause the problem.

    you may also want to adjust the code slightly to

    Please Login or Register  to view this content.
    its always best to avoid select staments , however i wouldnt have thought this would fix the code

  8. #8
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    UGH! I tried to not use select statements to begin with but I couldn't get the object.property thing correct for assigning sheet names. I replaced the old code with what you wrote, and it works great for defining the variables but I still get the same error as before.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Stupid Input Box Error 2015

    Where exactly do you get the error?

    What exactly is the code meant to do?

  10. #10
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    The error is that the variable, instead of being defined via the users input into the input box it literally gets defined as "Error 2015" which is USELESS to me.

    The code is designed to use the excel's text to columns feature depending on the length of a string size.

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Stupid Input Box Error 2015

    The code won't work because Application.Len("A1") will always return 2.

    Give this code a try.

    It's really just a kind of guess based on the code you posted, I think if we could have a workbook to work with it might help.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    OH MY GOD HOW DO YOU PEOPLE GET SO GOOD AT THIS ! lol. Yes. Yes that does precisely what I want it to. But. The problem is. I suck. And I don't understand why it's working.

    OK I'll switch out the old crappy code for this newer awesome code and I'll try to learn it thanks so much !

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Stupid Input Box Error 2015

    Not sure if it's what you want but this code will go down column A applying the appropriate
    text to columns where required.


    Please Login or Register  to view this content.
    Last edited by Norie; 11-02-2012 at 03:44 PM.

  14. #14
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    With the above code I get "Type Mismatch" on this line:

    Please Login or Register  to view this content.
    I tried changing the variable Dim to a couple of things but all was ... fruitless. I'm sure you picked Long for a reason

    When I remove Val() it switches to subscript out of range. End xl up has a value of -4162, with rows.count having a value of 1048576. So I have an idea of what that may mean in the above line
    Last edited by tomn13; 11-05-2012 at 09:41 AM. Reason: added more diagnostic information

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Stupid Input Box Error 2015

    What has been entered for prelimorfinal?

  16. #16
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    In the input box I put "2" -- without quotes, obviously

    And when I hover the mouse over 'prelimorfinal' it does say: "2"

    With quotes, which is normal I'm pretty sure.

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Stupid Input Box Error 2015

    This is my mistake, and I'm surprised it hasn't happened before.

    Anwyay it should be this.
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    04-29-2011
    Location
    islip, ny
    MS-Off Ver
    Excel 2003
    Posts
    27

    Re: Stupid Input Box Error 2015

    Perfect perfect perfect! The only thing I changed with your code was:

    Please Login or Register  to view this content.
    You had 3's there. And it shoved the information three rows below and turned into fajibblejabble. I am so thrilled with your help, this is astounding. !! YAY !! You have made my life so much easier and I've been able to learn a lot from this.

  19. #19
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Stupid Input Box Error 2015

    The reason I had a 3 there was because in the original code you were splitting A1 but you'd specified the destination as A4.

    I did think it was a bit strange, but it was your code so who am I to say.

    PS You don't need the Offset thing at all.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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