Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default finding empty selection

how do I find out if the selected cells have no content ie. no text,
charts, links etc?

Chimanro

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default finding empty selection

if application.counta(selection) = 0 then

would be a start. Cells can't contain charts, so I don't see that as an
issue.

--
Regards,
Tom Ogilvy


"Chimanrao" wrote in message
oups.com...
how do I find out if the selected cells have no content ie. no text,
charts, links etc?

Chimanro



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default finding empty selection

Take a look at IsEmpty or IsNull as a way to determine presence of content
in a Cell e.g.

If IsEmpty(Range("A1")) then MsgBox "A1 is Empty"

--
Cheers
Nigel



"Chimanrao" wrote in message
oups.com...
how do I find out if the selected cells have no content ie. no text,
charts, links etc?

Chimanro



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default finding empty selection

Just some added information:

IsNull has no play in this situation that I can see.

IsEmpty is only pertinent to a single cell (selection can be multiple cells
and the OP does say cells with an s) - So a loop might be required to use
IsEmpty

--
Regards,
Tom Ogilvy

"Nigel" wrote in message
...
Take a look at IsEmpty or IsNull as a way to determine presence of

content
in a Cell e.g.

If IsEmpty(Range("A1")) then MsgBox "A1 is Empty"

--
Cheers
Nigel



"Chimanrao" wrote in message
oups.com...
how do I find out if the selected cells have no content ie. no text,
charts, links etc?

Chimanro





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default finding empty selection

Agreed Tom, I was building on your example to show another method albeit for
Cell (singular without the s).

IsNull was a nonsense suggestion I agree !
--
Cheers
Nigel



"Tom Ogilvy" wrote in message
...
Just some added information:

IsNull has no play in this situation that I can see.

IsEmpty is only pertinent to a single cell (selection can be multiple

cells
and the OP does say cells with an s) - So a loop might be required to

use
IsEmpty

--
Regards,
Tom Ogilvy

"Nigel" wrote in message
...
Take a look at IsEmpty or IsNull as a way to determine presence of

content
in a Cell e.g.

If IsEmpty(Range("A1")) then MsgBox "A1 is Empty"

--
Cheers
Nigel



"Chimanrao" wrote in message
oups.com...
how do I find out if the selected cells have no content ie. no text,
charts, links etc?

Chimanro









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default finding empty selection

You could also try the specialcells method. For example

Range("A1:A10").SpecialCells(xlCellTypeBlanks).Add ress

returns the adresses of the blanks within the range a1:a10

Cheers

Andy

"Nigel" wrote:

Agreed Tom, I was building on your example to show another method albeit for
Cell (singular without the s).

IsNull was a nonsense suggestion I agree !
--
Cheers
Nigel



"Tom Ogilvy" wrote in message
...
Just some added information:

IsNull has no play in this situation that I can see.

IsEmpty is only pertinent to a single cell (selection can be multiple

cells
and the OP does say cells with an s) - So a loop might be required to

use
IsEmpty

--
Regards,
Tom Ogilvy

"Nigel" wrote in message
...
Take a look at IsEmpty or IsNull as a way to determine presence of

content
in a Cell e.g.

If IsEmpty(Range("A1")) then MsgBox "A1 is Empty"

--
Cheers
Nigel



"Chimanrao" wrote in message
oups.com...
how do I find out if the selected cells have no content ie. no text,
charts, links etc?

Chimanro








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default finding empty selection

You can select the background cells of a chart and press ctrl + c and
the chart also gets copied.
When I do GetSelection() in this case I get a Range object. In this
case all the cells can be empty but a chart object does exist in the
selection.

The the second scenario is when the user selects the chart object by
clicking on it. In this case when I use GetSelection i get a object but
its not of type range. which type is this object of?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test for an empty selection Edward Ulle Excel Programming 4 September 8th 05 02:54 PM
Finding the first empty row with VBA Melker Excel Programming 4 October 22nd 04 08:02 PM
List Selection to First Empty Row depuyus Excel Programming 2 July 30th 04 09:48 PM
Selection of non-empty cells Adrian[_7_] Excel Programming 6 July 22nd 04 01:06 PM
Finding last row that is empty poppy Excel Programming 4 July 8th 04 09:49 PM


All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"