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
- 2849 reads
Recent comments
5 years 50 weeks ago
6 years 36 weeks ago
6 years 48 weeks ago
6 years 51 weeks ago
7 years 1 day ago
7 years 5 weeks ago
7 years 13 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago