ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing Range Extent (https://www.excelbanter.com/excel-programming/389564-testing-range-extent.html)

Nigel RS[_2_]

Testing Range Extent
 
Hi All
How can I test in VBA if the selected range is a single cell or multiple
cells or multiple range of cells?

Many thanks

Cheers

Gary''s Student

Testing Range Extent
 
Sub howmany()
MsgBox (Selection.Count)
MsgBox (Selection.Areas.Count)
End Sub

--
Gary''s Student - gsnu200722

Nigel RS[_2_]

Testing Range Extent
 
Many thanks

"Gary''s Student" wrote:

Sub howmany()
MsgBox (Selection.Count)
MsgBox (Selection.Areas.Count)
End Sub

--
Gary''s Student - gsnu200722



All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com