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

No comments:

Post a Comment

Import data from SQL

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