This is not the usedrange
issue.
For example in Excel user selects a range (possibly empty) using mouse, let's say B4:C12
And let's say after this without deselecting the range user presses the macro, and macro should tell B4:C12.
Can anyone show example?
The macro should be something along the lines of the following:
Sub showrng()
MsgBox SelectedRange.Address(ReferenceStyle:=xlA1)
End Sub
Sub macro1()
MsgBox Selection.Address(ReferenceStyle:=xlA1, _
RowAbsolute:=False, ColumnAbsolute:=False)
End Sub
HTH!
Sub macro1()
MsgBox Selection.Address
End Sub
or
Sub macro1()
Dim addr as String
addr = Selection.Address
msgbox addr
' Now, as we found the address, according to that... you can also do other operations
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With