Showing posts with label UDF to extract Column Name. Show all posts
Showing posts with label UDF to extract Column Name. Show all posts

Friday, April 5, 2013

UDF to extract Column Name

If you want to extract the column name from a range. Try this UDF



Function colname(rng As Range) As String
    Dim arr As Variant
    arr = Split(rng.Address, "$")
    colname = arr(1)
End Function

Import data from SQL

Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...