+ Reply to Thread
Results 1 to 3 of 3

Userform TextBox ControlSource overwritten

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    24

    Userform TextBox ControlSource overwritten

    Hi

    I have a simple userform that has 3 textboxes - txt1, txt2 and txt3

    txt1.controlsource="=$a$1"
    txt2.controlsource="=$a$2"
    txt3.controlsource="=$a$3"

    on my worksheet I have formula in a3 = a1 + a2

    If I then run my form and put some value in txt1 and txt2 then txt3 is calculated. 10 + 11 = 21 for example.

    BUT a3 on my worksheet now has the value not the formula ie 21 not "=a1+a2".

    How can I stop the formula in A3 being overwritten?

    Thanks

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,305

    Re: Userform TextBox ControlSource overwritten

    you cannot have both - either the cell has a formula or you write a value to it - if you just want to see the calculated value of $a$3 write it back to a 'label.caption'

    Using the ControlSource property means the cell value will be displayed whenever the form is called and changes will be written to the cell immediately.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    09-18-2012
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    24

    Re: Userform TextBox ControlSource overwritten

    Thank you. Understood.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Highlight Erroneous Text In Textbox To Be Overwritten
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-01-2019, 01:25 PM
  2. Assign controlsource of multiple textbox by textbox name
    By snoob1674 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2015, 09:41 PM
  3. xl2013: setting .ControlSource of TextBox runs on error
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-03-2013, 03:51 PM
  4. Help With userform (ControlSource)
    By hogdawg in forum Excel General
    Replies: 0
    Last Post: 05-10-2011, 05:21 PM
  5. UserForm: visualise ControlSource
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2007, 04:23 PM
  6. [SOLVED] TextBox ControlSource
    By marwan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2005, 02:05 PM
  7. Replies: 2
    Last Post: 02-24-2005, 05:06 AM

Tags for this Thread

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