+ Reply to Thread
Results 1 to 3 of 3

vba userform

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    204

    vba userform

    Hi I am wondering whether you could help me with an excel formulae. I will need to send the excel sheet to you as it is a little complicated.

    see excel file

    how to creat userform with below formulae :



    Private Sub cboCat_Change()
    Dim rngCP As Range
    Dim c As Range
    Dim cbC As String
    Dim cbP As String
    Dim bKeep As Boolean
    On Error Resume Next
    Set rngCP = ThisWorkbook.Names("CatProd").RefersToRange
    Debug.Print rngCP.Address

    If Not Me.cboCat Is Null Then
    cbC = Me.cboCat.Value
    End If
    If Not Me.cboProd Is Null Then
    cbP = Me.cboProd.Value
    End If

    With Me.cboProd
    .Clear
    For Each c In rngCP
    If c.Value = cbC Then
    .AddItem c.Offset(0, 2).Text
    .List(.ListCount - 1, 1) _
    = c.Offset(0, 1).Text
    If c.Offset(0, 2).Text _
    = cbP Then
    bKeep = True
    End If
    End If
    Next c
    If bKeep = True Then
    .Value = cbP
    End If
    End With

    End Sub
    Attached Files Attached Files
    Last edited by kirana2014; 09-21-2015 at 02:34 PM.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: vba userform

    here is your loadable list.

    combo loadlists cookies.xls

  3. #3
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    204

    Re: vba userform

    thank you so mucht Ranman

    well done

    Kirana

+ 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] Save data from UserForm into Sheet (how to resolve runtime errors in UserForm tutorial)
    By eighty6 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-14-2015, 07:41 PM
  2. Userform Combobox - select from list, store this as default each time userform loads
    By thecdnmole in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2014, 07:48 AM
  3. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  4. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  5. [SOLVED] Changed userform combobox to listbox, unable to get userform to retrieve datasheet values
    By dragonabsurdum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2013, 01:38 PM
  6. [SOLVED] Open a userform from a userform, but preserve the info in the original userform
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2013, 02:38 PM
  7. userform is large.....how to use scrollbar of userform to show all of the userform
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2010, 04:11 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