+ Reply to Thread
Results 1 to 3 of 3

Userform textbox dous not write to the worksheet

  1. #1
    Registered User
    Join Date
    02-04-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    2

    Userform textbox dous not write to the worksheet

    I think this is a simple question but because i'm new to VBA coding its a mindbreaker for me...

    I'm building a simple userform so the user can put in the values in a form instead of the Excel worksheet. In this userform there are nummers like 1,20 (comma separated numbers) when these numbers are placed on the worksheet there is no calculation made when I enter an number without a comma the calculation is being made (at the worksheet i want to keep the calculations, I do not want to transfer the calculations to the VBA, this is more convienient for me)

    When I enter the "fresh value" direct is the worksheet cel the calculation is made... What am I doing wrong???

    I've seen that I have to calculate or activate the sheet so I can Write DIRECT into the sheet, Please help. ;-)


    Here the code I'm using...

    Please Login or Register  to view this content.
    Last edited by Mieska; 02-10-2012 at 07:31 PM. Reason: Added Code Tags

  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: Userform textbox dous not write to the worksheet

    There' no point declaring a variable ws, giving it a value then not using it. In this example it's not really necessary

    You don't need to activate the worksheet.

    The values in the TextBoxes are by default Strings, so cannot be used in calculations. You ned to convert them to a numeric value by using CDbl for a decimal value or Clng., or simply use Val

    Please Login or Register  to view this content.
    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
    02-04-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Userform textbox dous not write to the worksheet

    Thanks mate, this solved the problem.. As I said I'm new...
    The only thing is that my value has to be as 0.20 instead of the usual 0,20 (wich is my normal input value) If I use the Comma than the value is set to a roud figure...
    I want to learn about codes, can someone call out some sites where I can see different codes and sites where coding is explained.

    Thanks in advance for all the answers.

    Newbie Mieska

+ 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