+ Reply to Thread
Results 1 to 4 of 4

Percentage in VBA not reflecting properly in Excel cell

  1. #1
    Registered User
    Join Date
    03-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    13

    Percentage in VBA not reflecting properly in Excel cell

    Hi,
    I am new to this forum and new to the programming in VBA. Please spare me if i any silly question.

    What i am trying to achieve here is i have a text box in the VBA form the numeric value which i have entered in the text box will be give back to the excel cell "A1" in the attachment through the controlsource options in the text box option. But when i enter the whole number as "100" then the excel reads as "10000%" and when i have enter the text box with 100% then the excel reads as 100% and the text box change to 1 (like wise for all the values if i type 80% the excel will read "80%" but the text box will read as "0.8"

    Can any one help me how to keep the formatting as 80% in the text-box and the cell "A1" also reads 80% in the excel. Is there any way i can change the setting in the text-box as percentage. Please find the attached screenshot and excel. thanks for you help

    Note: I have the cell formatted as percentage in the excel and i want that to be that way.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Percentage in VBA not reflecting properly in Excel cell

    did you set the textbox's control source property? (I'm on an iPad so can't view the file)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Percentage in VBA not reflecting properly in Excel cell

    Remove the Control source for Textbox1 and use something like this to read\write the value to A1

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-02-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Percentage in VBA not reflecting properly in Excel cell

    Quote Originally Posted by JosephP View Post
    did you set the textbox's control source property? (I'm on an iPad so can't view the file)
    Yes Joseph, i have set the control source property of textbox1 to the cell name. So that what ever we enter in the text box will reflect in the cell.

+ 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