+ Reply to Thread
Results 1 to 2 of 2

Checkbox that dictates control source in userform.

  1. #1
    Registered User
    Join Date
    11-02-2014
    Location
    New York
    MS-Off Ver
    2013
    Posts
    4

    Checkbox that dictates control source in userform.

    Hello,

    In my userform I have checkbox1. In textbox1 I am trying to set its control source based on the value of checkbox1.

    I have entered into the control source of textbox1 the following code (which does not work):

    =iif([checkbox1]=True,A1,A2)

    Any ideas how I can get this to work?

    Thanks

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Checkbox that dictates control source in userform.

    Try =IIF(CheckBox1.Value, Range("A1"), Range("A2")).Address(,,,true)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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. [SOLVED] Trouble Using Control Source in UserForm
    By JPascal in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-02-2014, 09:40 PM
  2. [SOLVED] UserForm - Could not set the Control source property?
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-09-2013, 10:46 AM
  3. Userform Number Format with Control Source
    By okelly in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-11-2012, 07:42 PM
  4. Control Source Updates in Userform
    By incjourn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-13-2009, 02:23 PM
  5. Checkbox control on userform
    By Kent McPherson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-04-2005, 07:20 AM

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