+ Reply to Thread
Results 1 to 9 of 9

Can anyone tidy my Textbox minus Combobox Please?

  1. #1
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Can anyone tidy my Textbox minus Combobox Please?

    Hi, I've put some code together to achieve:

    TextBox7 - Combobox19 = TextBox9

    However, I think I've cocked this up! Help

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can anyone tidy my Textbox minus Combobox Please?

    You have too many right brackets - delete the ones in red:
    Please Login or Register  to view this content.
    But you don't need the variable, in this case - you could simplify to just:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can anyone tidy my Textbox minus Combobox Please?

    It doesn't seem to be working. Is it because they're text boxes as opposed to Combo?

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can anyone tidy my Textbox minus Combobox Please?

    Quote Originally Posted by bralew View Post
    It doesn't seem to be working. Is it because they're text boxes as opposed to Combo?
    That depends what you mean by "not working".

    Attach a workbook....

    (and please, consider my earlier advice about renaming your controls to something more meaningful!)

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Can anyone tidy my Textbox minus Combobox Please?

    Why use the Change-event of your target TextBox ? use the Change-event from either TextBox7 or Combobox19.
    Don't forget to put in a check to see that both source controls are filled.

    @ Olly

    consider my earlier advice about renaming your controls to something more meaningful
    As I see it that's a bad idea because you prohibit yourself that way in using easy to program loops to fill your controls. But that of course is my personal opinion .
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can anyone tidy my Textbox minus Combobox Please?

    Quote Originally Posted by bakerman2 View Post
    @ Olly

    As I see it that's a bad idea because you prohibit yourself that way in using easy to program loops to fill your controls. But that of course is my personal opinion .
    An interesting debate - for another thread

  7. #7
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can anyone tidy my Textbox minus Combobox Please?

    Here's the workbook chaps

    choose 54 square in the first user form and you'll be into the main userform.
    Attached Files Attached Files

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can anyone tidy my Textbox minus Combobox Please?

    Try putting the code in the TextBox7_Change event:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-05-2016
    Location
    cardiff
    MS-Off Ver
    2010
    Posts
    787

    Re: Can anyone tidy my Textbox minus Combobox Please?

    Ahh Thanks Ol, didnt see that lurkinyg

+ 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. Replies: 0
    Last Post: 08-18-2015, 04:13 PM
  2. Combobox and textbox
    By Arvin.Amaro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2015, 07:19 PM
  3. input the value of a Combobox and a textbox to a TEXTBOX directly from a userform
    By Gordonhk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2013, 03:25 PM
  4. Textbox value to add item in Combobox
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-14-2013, 06:56 PM
  5. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  6. combobox /textbox value
    By flow23 in forum Excel General
    Replies: 0
    Last Post: 04-19-2006, 10: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