XLA routines: EE_GetColElements
Use EE_GetColElements to get an range of column elements
Function EE_GetColElements(rngTableWithHeader As range, strColName As String) As Variant Dim intCol As Integer Dim rng As range Dim arr As Variant Dim arr2 'http://excelexperts.com/xla-routines-eeGetColElements for updates on this function intCol = Application.WorksheetFunction.Match(strColName, rngTableWithHeader.Rows(1), 0) With rngTableWithHeader Set rng = Intersect(.Columns(intCol), .Columns(intCol).Offset(1)) EE_GetColElements = rng If rngTableWithHeader.Rows.Count = 2 Then ReDim arrTemp(1 To 1, 1 To 1) arrTemp(1, 1) = rng.value EE_GetColElements = arrTemp Else EE_GetColElements = rng End If End With End Function
»
- Nick's blog
- Login or register to post comments
- 2782 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago