Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Formula Help Needed
I have a spreadsheet in which Sheet1(X1:X100) contains a list of
unique names. On my Userform I have ComboBox1 and TextBox1. ComboBox1 has it's rowsource as Sheet1(X1:X100). My Data Sheet2(A2:A500)contains rows of the names inputted from ComboBox1. I am trying to get TextBox1 on my Userform to count the number of times the same name occurs in range Sheet2(A2:A500)when a change occurs in ComboBox1. What is the Sub formula I can use for this change() event? Any help is appreciated. Tim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Formula Help Needed
Tim,
This should do it Private Sub ComboBox1_Change() TextBox1.Text = WorksheetFunction.CountIf(Worksheets("Sheet2"). _ Range("A2:A500"), ComboBox1.Value) End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "timh2ofall" wrote in message . .. I have a spreadsheet in which Sheet1(X1:X100) contains a list of unique names. On my Userform I have ComboBox1 and TextBox1. ComboBox1 has it's rowsource as Sheet1(X1:X100). My Data Sheet2(A2:A500)contains rows of the names inputted from ComboBox1. I am trying to get TextBox1 on my Userform to count the number of times the same name occurs in range Sheet2(A2:A500)when a change occurs in ComboBox1. What is the Sub formula I can use for this change() event? Any help is appreciated. Tim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Formula Help Needed
I have a spreadsheet in which Sheet1(X1:X100) contains a list of
unique names. On my Userform I have ComboBox1 and TextBox1. ComboBox1 has it's rowsource as Sheet1(X1:X100). My Data Sheet2(A2:A500)contains rows of the names inputted from ComboBox1. I am trying to get TextBox1 on my Userform to count the number of times the same name occurs in range Sheet2(A2:A500)when a change occurs in ComboBox1. What is the Sub formula I can use for this change() event? Any help is appreciated. When you change ComboBox1 make sure the change event copies the new name to a worksheet cell, sheet2(A501). In sheet2(A502) add this: countif("A2:A500",A501) Set TextBox1 to display the contents of sheet2(A502) HTH Chris |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
needed formula | Excel Worksheet Functions | |||
Excel formula to copy/paste formula needed please. | Excel Discussion (Misc queries) | |||
Userform button setting variable from formula | Excel Discussion (Misc queries) | |||
Userform button setting variable from formula | Excel Discussion (Misc queries) | |||
A pointer or two needed using userform | Excel Programming |