+ Reply to Thread
Results 1 to 7 of 7

TextBox format, input is currency, can't output onto other sheet

  1. #1
    Registered User
    Join Date
    08-20-2009
    Location
    NC
    MS-Off Ver
    Excel 2000
    Posts
    21

    TextBox format, input is currency, can't output onto other sheet

    The form in question works as follows:

    User will put in a ID number, hit FIND, and then the form will populate with Opportunity Names and Opportunity $Amounts for each match of the ID found from another workbook.

    The User then hits POPULATE and the form matches the ID, Name, and $Amount, to the 2nd workbook and copies values from the 2nd workbook and place them in the original workbook that holds the form.

    If the $Amount is TEXT in the 2nd workbook, I can get the 3 matches to work and it will copy the values. However, if it is in CURRENCY, as it currently is, it does not see the three values as matching and stops the routine.

    I can make the $Amount textbox (textbox3) into currency using this:
    Please Login or Register  to view this content.
    and then calling it in the FIND routine before the end sub command.

    That formats the texbox in the form as a currency, but then when it tries and matches it still can't seem to recognize and run. Below is the code for the Find procedure, and then the Populate procedure.

    I was considering running a looped command that converted the Currency values in the 2nd workbook to TEXT, but would really prefer to leave as is. Does anyone have any ideas to make the code work as it is?

    FIND
    Please Login or Register  to view this content.
    POPULATE
    Please Login or Register  to view this content.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: TextBox format, input is currency, can't output onto other sheet

    A number formatted as currency in a worksheet will remain a number. If the textbox is formatted as currency it is a string. You can convert the textbox entry to a urrency variable by using CCur then use that in the Find routine
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    08-20-2009
    Location
    NC
    MS-Off Ver
    Excel 2000
    Posts
    21

    Re: TextBox format, input is currency, can't output onto other sheet

    I saw this in another posting of yours on the subject:

    CCur(TextBox1.Value) - Currency

    but I am not sure how to implement this.

    Do I need to Dim Textbox3 and say textbox3=ccur(textbox3.value)? Where would I put this in the FIND routine? After TextBox3=ws.cells(i,4)?

    I saw on another forum this:
    Please Login or Register  to view this content.
    Not really sure what to do here.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: TextBox format, input is currency, can't output onto other sheet

    I can't see a Find routine in your posted code

  5. #5
    Registered User
    Join Date
    08-20-2009
    Location
    NC
    MS-Off Ver
    Excel 2000
    Posts
    21

    Re: TextBox format, input is currency, can't output onto other sheet

    It was posted in the original post - I currently use a form that once the user enters an ID number and clicks a button, it searches the 2nd workbook for the data and posts it in the text boxes. From there the user can chose which data set they want and click a populate button to then transfer data from the 2nd workbook to the first.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: TextBox format, input is currency, can't output onto other sheet

    I think you are using a loop to find a match. I was expecting the Find function, which would be much better than the method you are using.

  7. #7
    Registered User
    Join Date
    08-20-2009
    Location
    NC
    MS-Off Ver
    Excel 2000
    Posts
    21

    Re: TextBox format, input is currency, can't output onto other sheet

    The code works fine as it is when performing its function up until this point. If the $Amount column's data is text and has a $ at the beginning of it, then the program does its function. So say I make the cell say $48000 in text, it targets the specific data I want. The issue is I would like to have that portion automated so that when they first run the Find, it will convert the column into text like that OR there is some way around the text box. Which is what I was asking. Can you advise on that?

+ 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