View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] james.billy@gmail.com is offline
external usenet poster
 
Posts: 69
Default Easy way to test range as single cell

On 9 Dec, 17:45, Dallman Ross <dman@localhost. wrote:
I'm trying to come up with an easy way in VBA to know if
the selected range is one single cell only -- and from a
restricted range of cells. I suspect this is trivially
easy to do, but the how of it escapes me at this moment.
Ideas gladly solicited.

dman


If the user has already selected the range then it would be:

if Selection.Cells.Count 1 then
Msgbox "More than one cell is selected"
end if

James