+ Reply to Thread
Results 1 to 9 of 9

Creating IF statement for iRow Entry

  1. #1
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Creating IF statement for iRow Entry

    Hello,

    What Im trying to do is probably fairly simple, but I haven't been able to get it. What I basically am trying to do is, if a user selects "Apples" from combo-box3, I want the value from textbox 1 inserted on iRow, 3....If the word Oranges is selected from the combo-box 3 then I want the value in textbox 1 to be inserted on iRow, 4

    So here's my code so far, but its not working:
    Please Login or Register  to view this content.
    any ideas why that isn't working?

    Thanks for the help

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Creating IF statement for iRow Entry

    Insert a Debug.Print Me.ComboBox3.Value in there to double-check the value of the ComboBox

  3. #3
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Creating IF statement for iRow Entry

    Hey there

    I tried that, still doesnt work.

    Quote Originally Posted by Whizbang View Post
    Insert a Debug.Print Me.ComboBox3.Value in there to double-check the value of the ComboBox

  4. #4
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Creating IF statement for iRow Entry

    What errors are you getting? What is it doing or not doing?

    The only issue I got was that it was putting the row number in column A, but the values in the next row down.

    This worked fine for me:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Creating IF statement for iRow Entry

    So the user is using a userform I built to input the data onto the sheet.

    Its working as its supposed to except the value in textbox 1 needs to be put in one cell or the other depending on the selection of apples or oranges from the combo-box. Here is the full code, when the userform is submitted the data from the userform is actually getting entered on two sheets. The error Im getting is:
    "Runtime Error, Script out of Range", and its highlighting the line:

    "set ws worksheets("records"): ws.Activate"

    Please Login or Register  to view this content.
    Quote Originally Posted by Whizbang View Post
    What errors are you getting? What is it doing or not doing?

    The only issue I got was that it was putting the row number in column A, but the values in the next row down.

    This worked fine for me:
    Please Login or Register  to view this content.
    Last edited by excelenergy; 09-29-2014 at 04:22 PM.

  6. #6
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Creating IF statement for iRow Entry

    Is there a "Records" worksheet in the workbook? Double check the spelling and ensure there is no trailing Space character in the WS name.

  7. #7
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Creating IF statement for iRow Entry

    Basically, if 'Apples' is selected then the value of textbox1 should go into cell B3, if oranges is selected the value of textbox1 would go into cell B4

  8. #8
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Creating IF statement for iRow Entry

    You know what Whizbang, that was the problem, the sheet name had a spelling error!

    tHANKS for the second set of eyes and the suggestion!!


    Quote Originally Posted by Whizbang View Post
    Is there a "Records" worksheet in the workbook? Double check the spelling and ensure there is no trailing Space character in the WS name.

  9. #9
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Creating IF statement for iRow Entry

    Glad you got it to work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Combinations and iRow formula
    By Fitz1567 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2013, 12:13 AM
  2. [SOLVED] Creating a Record Entry Bar - Possible?
    By diggers16 in forum Excel General
    Replies: 15
    Last Post: 12-27-2012, 03:04 PM
  3. [SOLVED] Issue using iRow
    By faoltaem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2012, 03:00 AM
  4. Define "iRow" as Row displayed after data is filtered
    By mgdmeyers in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2012, 10:41 AM
  5. Arranging data:Dim iRow As Long
    By vijaya in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2005, 12:45 PM

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