Results 1 to 3 of 3

using function sumif to populate values into textbox based on selected combobox

Threaded View

  1. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,005

    Re: using function sumif to populate values into textbox based on selected combobox

    the list of names in column F were all mis-spelt! and SUMIF was incorrect

    Private Sub UserForm_Initialize()
        Set Rng = sheet1.Range("f2", sheet1.Range("f" & Rows.Count).End(xlUp))
        Me.ComboBox1.RowSource = Rng.Address
    End Sub
    
    Private Sub ComboBox1_Change()
    Me.TextBox1.Value = WorksheetFunction.SumIf(Range("B:B"), ComboBox1.Value, Range("C:C"))
    Me.TextBox2.Value = WorksheetFunction.SumIf(Range("B:B"), ComboBox1.Value, Range("D:D"))
    Me.TextBox3.Value = TextBox1.Value - TextBox2.Value
    End Sub
    Last edited by JohnTopley; 01-15-2022 at 10:23 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Populate Data off Combobox and Textbox Values
    By Kyhosa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2020, 12:11 PM
  2. [SOLVED] populate values into textbox on userform based on multiple combobox and two optionbuttons
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2020, 12:52 AM
  3. [SOLVED] Auto populate textbox value based on combobox value
    By justin1202 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2015, 04:01 AM
  4. [SOLVED] Textbox - populate with month name and values based on Combobox selection
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2015, 08:09 AM
  5. Textbox to populate based on combobox selection
    By acroley1 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-11-2015, 04:12 PM
  6. Populate TextBox based off ComboBox selection
    By ladams41 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2014, 01:24 PM
  7. [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

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