views:

69

answers:

1

Hi All, 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? Thanks a lot in advance!

the macro should be smth along the lines of the following:

      Sub showrng()
          MsgBox SelectedRange.Address(ReferenceStyle:=xlA1)
      End Sub
+1  A: 
Sub macro1()
  MsgBox Selection.Address(ReferenceStyle:=xlA1, _
                           RowAbsolute:=False, ColumnAbsolute:=False)
End Sub

HTH!

belisarius
Of course, it does! Thanks!
sdfg
+1 but ReferenceStyle:=xlA1 would match the requirements of the question more closely
barrowc
@barrowc Yup ... intended to type that. Edited. Thanks!
belisarius