how do I find out if the selected cells have no content ie. no text,
charts, links etc?
Chimanro
how do I find out if the selected cells have no content ie. no text,
charts, links etc?
Chimanro
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" <[email protected]> wrote in message
news:[email protected]...
> how do I find out if the selected cells have no content ie. no text,
> charts, links etc?
>
> Chimanro
>
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" <[email protected]> wrote in message
news:[email protected]...
> how do I find out if the selected cells have no content ie. no text,
> charts, links etc?
>
> Chimanro
>
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" <[email protected]> wrote in message
news:[email protected]...
> 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" <[email protected]> wrote in message
> news:[email protected]...
> > how do I find out if the selected cells have no content ie. no text,
> > charts, links etc?
> >
> > Chimanro
> >
>
>
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" <[email protected]> wrote in message
news:eqUe%[email protected]...
> 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" <[email protected]> wrote in message
> news:[email protected]...
> > 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" <[email protected]> wrote in message
> > news:[email protected]...
> > > how do I find out if the selected cells have no content ie. no text,
> > > charts, links etc?
> > >
> > > Chimanro
> > >
> >
> >
>
>
You could also try the specialcells method. For example
Range("A1:A10").SpecialCells(xlCellTypeBlanks).Address
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" <[email protected]> wrote in message
> news:eqUe%[email protected]...
> > 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" <[email protected]> wrote in message
> > news:[email protected]...
> > > 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" <[email protected]> wrote in message
> > > news:[email protected]...
> > > > how do I find out if the selected cells have no content ie. no text,
> > > > charts, links etc?
> > > >
> > > > Chimanro
> > > >
> > >
> > >
> >
> >
>
>
>
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?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks