I have a following code which displays the Range address in the msg box after executing the code
I am looking to copy and paste Range address to any of the Selected cell.
I would appreciate if any one could help to customize the code and get the desired result.
Thanks in anticipation
I am looking to copy and paste Range address to any of the Selected cell.
VBA Code:
Sub GetRangeAddress()
Dim r As Range
Dim s As String
Select Case Selection.Areas.Count
Case 0:
MsgBox "Nothing selected."
Case 1:
MsgBox "Selected range: " & Selection.Areas(1).Address(False, False)
Case Else
s = ""
For Each r In Selection.Areas
s = s + vbNewLine + r.Address(False, False)
Next r
MsgBox "Selected several areas:" & s
End Select
End Sub
I would appreciate if any one could help to customize the code and get the desired result.
Thanks in anticipation