Range to text conversion
Is there a way to convert a reference to a range of cells into a text string.
In other words, given an Excel Function that returns a reference to a range,can that range address be converted to a text string?
Dennis Irvine
Software
Is there a way to convert a reference to a range of cells into a text string.
In other words, given an Excel Function that returns a reference to a range,can that range address be converted to a text string?
Dennis Irvine
by zalog
by sankulpune
Hello Dennis,
The 'address' property (VBA for Excel 2000) of a range object returns the range as string. Following example will clarify.
1) Open a worksheet and in the VBE (VBA Editor) paste the following code:
Sub rng2txt()
Dim rng As Range
Set rng = Selection
txt = rng.Address
End Sub
2) Go back to worksheet, select a range.
3) Return to VBE and run the code.
'txt' returns the range as string which you can process further.
Hope this helps.
Please do not hesitate to contact me if you need clarifications / more info.
With regards,
SanganakSakha
'Effective and Simple Solutions To Small Problems, No QuickFixes"
This discussion is closed to new replies.
Sort by Trending