+ Reply to Thread
Results 1 to 5 of 5

For loop with Textbox in userform

  1. #1
    Registered User
    Join Date
    01-10-2008
    Posts
    27

    For loop with Textbox in userform

    Hmm....cant seem to find an answer for this one anywhere...

    Why cant i go:

    Please Login or Register  to view this content.
    Thanks,

    Paul

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Toadums,

    Your code isn't complete. This assumes you are running the macro outside of the UserForm on the worksheet.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    01-10-2008
    Posts
    27
    Thanks! still needs a lotta tweaking to be what i need it to be

    ooo Edit #2 ...i also wanna know why Leith used

    Please Login or Register  to view this content.
    ===============================

    I decided to scrap the whole IF statement thing cause it was just like If else if else if else a million times....so im trying Select Case now...i think that is the better way (correct me if im wrong ...)

    ok so this is what i have:

    Please Login or Register  to view this content.
    I have that linked to a command button that says

    Please Login or Register  to view this content.
    And now for my problem >.>

    So i have a user form that has (currently 12, once i figure this out, 100+) textboxes... it is for an evaluation form thing...i would just manually enter the digits in the form, but i have to do 59 of these, and the way they are formatted it SUCKS to fill them in cause ya...dont worry about that im just rambling back to my question..

    So what i want to happen is this: I enter a 1 in the first box and I get a 1 in the column for 1's (E) at the first row (first box = first row) and then second box say i enter a 4 i want a 4 to go into K21...ETC, ETC. But what is happening is when i put a 1 in box 1, it puts a 1 in every third row of column E...so it sorta half works...

    I guess what i need is for the "Range("E" & r).Value = TB.Value" part to be like...once it is entered in a row, go down to the next row...i was thinking something like Activecell.offset(3,0) but dont think that would work...i need it to kinda be like r for textbox 1 = 18, textbox 2 = 21.....until like textbox 100 = 300ish...

    That was super hard to explain....hopefully just looking at my code you can get what i am trying to do lol...

    Cheers
    Last edited by Toadums; 04-23-2008 at 06:05 PM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you be a little clearer/ You are entering data into a number of TextBoxes and then the button submits that data to the sheet. Are the cells that yo are inputting to fixed?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    01-10-2008
    Posts
    27
    Yup, they are fixed. well, the rows are fixed.

    So...like the response for the first textbox will go in row 18. But it will go in either cell cell E (if it is a 1), g (if it is a 2), I (if it is a 3), K (if it is a 4), or M (if it is a 5)

    ok there we go, i think that it makes sense now lol...

    so lets say i put a 1 in textbox1. Then a 1 would go in cell E18. And if in textbox2 i put a 4, then a 4 would go in K21. and all the way down the hundred or so textboxes.

    hth.

    Paul

+ 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