Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default intersect and combo box

I have a sheet ("Coding"). It has Cost Center numerical
codes running down column A, and Function Code numerical
codes running across row 1. In the intersecting cell
either the words yes or no appears. "Yes" if this is an
appropriate combination or "No" if it is not.

A userform is initiated and the employee selects a Cost
Center Code from a drop down Combo box. I need a code
that will then find that numeric code in the sheet "Coding
A:A" and will then populate Function Code Combo box
selections with only the Function Codes that can be
appropriately used. The code needs to look across the
cooesponding row and then insert the approriate Column
header for any cell that is labeled "Yes" for that Cost
Center.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default intersect and combo box

Dim rng as Range, cell as Range

set rng = Range(combobox1.Rowsource)
set rng = rng(combobox1.listindex + 1)

or
With Worksheets("Coding")
Set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End(xlup))
set rng = rng(combobox1.ListIndex + 1)
End with

then
combobox2.Clear
set cell = rng.offset(0,1)
do while not isempty( cell)
if Lcase(cell.value) = "yes" then
Combobox2.AddItem cell.parent.Cells(1,cell.Column).Value
end if
set cell = cell.offset(0,2)
Loop

--
Regards,
Tom Ogilvy


"scrabtree" wrote in message
...
I have a sheet ("Coding"). It has Cost Center numerical
codes running down column A, and Function Code numerical
codes running across row 1. In the intersecting cell
either the words yes or no appears. "Yes" if this is an
appropriate combination or "No" if it is not.

A userform is initiated and the employee selects a Cost
Center Code from a drop down Combo box. I need a code
that will then find that numeric code in the sheet "Coding
A:A" and will then populate Function Code Combo box
selections with only the Function Codes that can be
appropriately used. The code needs to look across the
cooesponding row and then insert the approriate Column
header for any cell that is labeled "Yes" for that Cost
Center.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intersect operations heyes Excel Worksheet Functions 4 February 14th 06 05:13 PM
Dont intersect JethroUK© Excel Programming 6 November 16th 03 08:40 PM
Intersect Formula??? scrabtree[_2_] Excel Programming 3 October 15th 03 08:30 PM
Intersect Formula VBA Help scrabtree Excel Programming 1 October 15th 03 02:08 PM
Help with If Not Intersect derek Excel Programming 6 July 11th 03 04:39 PM


All times are GMT +1. The time now is 05:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"