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
- 2752 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago