Results 1 to 4 of 4

Textbox - populate with month name and values based on Combobox selection

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Textbox - populate with month name and values based on Combobox selection

    Hi,

    I have dates in column A, drop-down list in column B, and values in column C. I want to display month name and values for each month If I select value from combobox.


    Example - value "P" (Combobox "Petrol") entered in column B:

    January : 233

    February : 345

    March : 444 etc...

    This is my code:

    Private Sub ComboBox1_Change()
    
    If ComboBox1.ListIndex = 0 Then
    
      For Each cell In Range("A1:A366")
         Select Case cell.Offset(, 1).Value
             Case "P"
             TextBox1.Text = Format(cell.Value, "mmmm") & " : " & cell.Offset(, 2).Value
         End Select
      Next cell
    End If
    
    End Sub
    Problem is that I get only one result displayed in textbox. How can I change this to all months ?

    Sample is attached !

    Thanks for help !
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I populate a specific range in one ComboBox based of selection of another ComboBox?
    By gmr4evr1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-04-2015, 04:32 PM
  2. 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
  3. Calculating/adding userform textbox values based on combobox selection and display to cell
    By SpreadsheetGirl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 08:57 AM
  4. Populate textbox based off ComboBox Selection
    By ladams41 in forum Excel General
    Replies: 1
    Last Post: 04-09-2014, 10:13 AM
  5. Populate TextBox based off ComboBox selection
    By ladams41 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2014, 01:24 PM
  6. [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
  7. [SOLVED] How do I make a selection from a combobox on my VBA userform populate a textbox?
    By ChristianMba in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2012, 01:08 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