+ Reply to Thread
Results 1 to 4 of 4

Copying data from a form to a cell

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    Panamá
    MS-Off Ver
    Excel 2007
    Posts
    8

    Copying data from a form to a cell

    Hi this is my first post

    Right now i have a vba that copies the data in the fields of a form and saves them on another sheet in a specific order.

    My issue is that there are some field that need to be saved as numbers but they apear to be text untill I double click on them and then they turn in to numbers.

    Im using excel 2007, bellow the code im using:

    Please Login or Register  to view this content.
    Thanks for any help you can provide
    Last edited by JBeaucaire; 06-12-2013 at 06:44 PM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copying data from a form to a cell

    If you know a text value is really a number, if you add zero to that text value, it becomes a real number.

    So, in your example, for instance, if NOMBRECIA is a value that IS a number but is being entered as text, two solutions I can suggest:

    1) Format that column as a specific number format first and perhaps the entries will be correct when VBA-entered later
    2) Use a +0 after the NOMBRECIA
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-11-2013
    Location
    Panamá
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Copying data from a form to a cell

    Thank you JB,

    That worked like a charm, also adding .value after the fiel (NOMBRECIA.VALUE) worked in the same way.

    Is it ok to ask another Q regarding the same code in here or do I have to create another post?.

    Example: it is the same project, same form, but now its about number format in the form field.

    Thanks again

    CV

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copying data from a form to a cell

    Its best not to treat a single thread as a "project" thread because other people seldom look at "actively answered threads", most new eyes are drawn to threads with zero or only a couple replies. Also, if you post only here, you'll be waiting on me.

    Each separate query in a separate thread means new eyes possibly responding quicker. If a helper stumps your thread without a working solution, ping a Moderator to take a look.

    If you do not get a response to a particular thread, resist the urge to "bump" it, that also takes it off the "Unanswered Threads" list above in the dark blue menu bar, you don't want to do that prematurely. If 24 hrs goes by with no responses, you can tug my sleeve with a Private Message and link to the thread.

    Some other contributors here view that as a violation of the rule #4 and don't like it, so tread carefully tugging other sleeves.



    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Thanks.

+ 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