+ Reply to Thread
Results 1 to 7 of 7

finding empty selection

  1. #1
    Chimanrao
    Guest

    finding empty selection

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

    Chimanro


  2. #2
    Tom Ogilvy
    Guest

    Re: 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" <[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
    >




  3. #3
    Nigel
    Guest

    Re: 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" <[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
    >




  4. #4
    Tom Ogilvy
    Guest

    Re: 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" <[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
    > >

    >
    >




  5. #5
    Nigel
    Guest

    Re: 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" <[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
    > > >

    > >
    > >

    >
    >




  6. #6
    Andy Ives
    Guest

    Re: finding empty selection

    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
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    >


  7. #7
    Chimanrao
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1