Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
K --
Thanks for your comments and for introducing me to these concepts. It will take a while to digest it. I'll probably be back. Larry "keepITcool" wrote in message ... Larry, a quick scan of your code.. .... 'Note: the form is currently shown.. 'IF you have already SET the rowsource of SelectComponent THEN 'you'll be working and clearing in the rowsource of the control.... 'That is slow.. may block cells, and trigger events on the form. 'So before working on a rowsource range be sure to "FREE" the range. Me.lstSelectComponent.RowSource = vbNullString Call FilterComponent_Rgn(g_strCellEqpSel, intRegionCode) Me.lstSelectComponent.RowSource = _ ThisWorkbook.Range("result_prod_rgn_nonnull").Addr ess(external: =True) End Sub Sub FilterComponent_List(ProdType As String, RegionCode As Integer) 'AVOID THE USE OF WINDOWS.. USE WORKBOOKS INSTEAD 'Windows(strBookSource) will not work if you have 2 windows for that book open. 'you could set a worksheet variable.. 'Dim ws As Worksheet 'Set ws = Workbooks(strBookSource).Worksheets(strSheetSource ) 'then EITHER use 'ws.Range 'or With/end with 'With ws 'OR you could do it in 1 line.. With Workbooks(strBookSource).Worksheets(strSheetSource ) 'within a WITH you need the DOT to "tunnel" 'populate ProductType and RegionCode cells in Sheet B .Range(strRangeCriteriaProdType).Value = ProdType .Range(strRangeCriteriaRgnCode).Value = RegionCode .Range(strRangeExtract).ClearContents .Range(strRangeData).AdvancedFilter _ Action:=xlFilterCopy, _ CriteriaRange:=Range(strRangeCriteria), _ CopyToRange:=Range(strRangeExtractTop), _ Unique:=True '... code to strip blank values in Sheet B's extract range and ' put non-null values into Sheet B's range "result_prod_rgn_nonnull" End With End Sub keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "L Mehl" wrote: Me.lstSelectComponent.RowSource = "result_prod_rgn_nonnull" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I lock a screen to prevent scrolling? | Excel Discussion (Misc queries) | |||
prevent big white screen | Excel Worksheet Functions | |||
how to let the userform autosize depending on the screen resolution | Excel Worksheet Functions | |||
Screen Updates on a userform | Excel Programming | |||
Userform Screen Location | Excel Programming |