+ Reply to Thread
Results 1 to 4 of 4

VBA Query to Excel, Stuck.

  1. #1
    Registered User
    Join Date
    05-26-2005
    Posts
    8

    VBA Query to Excel, Stuck.

    Hi,

    How do you copy the value from a TxtBox from a Userform to an Excel Cell as a number not text?

    So Txtbox value = 5

    How do you make it so that Cell A1 = 5 but as a number not text.

    Thanks

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,465
    Hi,

    try something like

    Sheets("YourSheetName").Range("a1")=YourFormName.Textbox1.Text

  3. #3
    Registered User
    Join Date
    05-26-2005
    Posts
    8
    Yea that works but it puts the value of the textbox in the cell as Text not a Number.

    Reason I need it as a number is because I use the SUMIF formula and it will not read the value of the cell if it is set as Text.

  4. #4
    Registered User
    Join Date
    05-26-2005
    Posts
    8
    Sorry , sorted it now.

    I forgot to put .value at the end of the textbox.

    Works fine now ahh well, we all make mistakes

    Just glad it works now!

+ 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