+ Reply to Thread
Results 1 to 5 of 5

match case

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    match case

    I have made a user form to update worksheet "sheet1" there is a one combo box I have created with buy and sale 2 components in it. when I select "buy" option its going well and all data being copy to excel sheet but when I choose "sale "option, I want a reference or unique component from previous entry from "Buy" which relates to "sale" entry and update next to same "buy" option i.e same row.But I am not able to get a perfect code for this as when i click on "Sale" data being copy but one by one row which is not correct. I have done something below, any solution?


    Please Login or Register  to view this content.
    Moderators note: code tags added for you - this time
    Last edited by FDibbins; 06-16-2013 at 05:42 PM.

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: match case

    Check to see if 'Sale' or 'sale' is the option from your ComboBox.
    The must be an exact match or else you will get no result to what you coded as a variable.

    Use something like:
    Please Login or Register  to view this content.
    Last edited by coreytroy; 06-16-2013 at 04:45 PM.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: match case

    Atul, hi and welcome to the forum

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: match case

    Thanks for quick reply, When I select Sale from Combo box its give me correct result if u see the code above, but my concern is I have already some data in rows with "buy" options in earlier dates for example for June 1 June 2 , June 3 and so on with range "A to N" respectively and "P" to "ab" for sale range.That means if I select "Buy" from combo box it goes to (A to N) row and if I select "Sale" option from combo box it goes to (P to AB)row, but on June 4 I have sold some stocks which was purchased on 2 nd June, but when I Select Sale from combo box it goes to first row not goes to the 2nd June row. I want to match and enter correct data into appropriate/relevant /correct row when I make a Sale entry. for ex, for 1 to 5 June I made "Buy" entries range "A to N" row series, now on June 6 I sold stocks which was purchased on 3 rd June, but when I click on "Sale" from combo box it goes to first row that is "P4 to AB4." I want data goes to appropriate row only when I select Sale order from combo box. I think for this there must be 1 or 2 unique components need as reference so the code makes perfect. I do not know how to do it either v look up or any match case code added to the existing code
    Last edited by FDibbins; 06-17-2013 at 11:41 AM.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: match case

    atul, you only need to use [code etc foir the VBA, not for regular comments

+ 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