Populate Array from a range in a closed workbook in vba
Hi,
i need help on populating an array in one of my subroutine from a range from a closed work book.
the workbook is in c:\drive under a folder.
is it possible to get the desired range say A1:A30 to an array?
Thanks for any help in advance
Raj :hi:
Populate Array from closed workbook
Dear Hob,
The link is not working. My code is here, pls help
[VBA]
Sub HideUnwantedEngrs(ByVal fName As String)
Dim pvtItem As PivotItem
Dim pvtField_ENGR As PivotField
' ArrayEngr = Workbooks("c:\data_analysis\Reference Table.xls").Sheets("Engr MAP").Range("A1:A30")
Set pvtField_ENGR = Worksheets("Pivot Table").PivotTables("INVENTORY-BLR").PivotFields("ENGR NO")
For Each pvtItem In pvtField_ENGR.PivotItems
Select Case pvtItem.Caption
Case "1783", "1790", "1801", "1807", "1856", "1857", "1874", "1888", _
"1897", "1898", "KA82", "KB75", "KB76", "KB84", "KB81", "KA81", "KA82", "KB83", "XB09"
pvtItem.Visible = True
Case Else
pvtItem.Visible = False
End Select
Next
Call savinv(fName)
End Sub[/VBA]
Raj :banghead:
Populate Array from closed workbook
Sorry, i'm not a programmer. could you pls give me how to call this function
in my code.
I want to get engr numbers which are in A2:A30(may be expanding when new engr added) in Sheet Engr MAP in C:\data_analysis\reference table.xls to an array.
: pray2:
Raj