+ Reply to Thread
Results 1 to 6 of 6

ClearContents of selected cell and cell validated as list/indirect

  1. #1
    AA Arens
    Guest

    ClearContents of selected cell and cell validated as list/indirect

    I created a button that clears the contents of a cell.

    The command in Pivate Sub is:
    Me.Range("B12", "B15").clearContents.


    What is the command when I want:

    1. to clear a selected cell? (same as right click)
    2. to clear a selected cell that is validated as list and it also
    crears the dependent cell right of it (validated by INDIRECT)

    Thank you.
    Bart


  2. #2
    Gary''s Student
    Guest

    RE: ClearContents of selected cell and cell validated as list/indirect

    To clear the selected cell:
    Selection.ClearContents

    To clear the cell to the immediate right of the selected cell:
    Selection.Offset(0, 1).ClearContents
    --
    Gary's Student


    "AA Arens" wrote:

    > I created a button that clears the contents of a cell.
    >
    > The command in Pivate Sub is:
    > Me.Range("B12", "B15").clearContents.
    >
    >
    > What is the command when I want:
    >
    > 1. to clear a selected cell? (same as right click)
    > 2. to clear a selected cell that is validated as list and it also
    > crears the dependent cell right of it (validated by INDIRECT)
    >
    > Thank you.
    > Bart
    >
    >


  3. #3
    AA Arens
    Guest

    Re: ClearContents of selected cell and cell validated as list/indirect

    Is there an Offset command that take a range of cells right of the
    active cell?
    I want to have the cells right of the active cell cleared, not only the
    one right of it.

    And, related to this, is the a row-clear command? That clears all cells
    left and right of the active cell (so far not protected and locked)?


    Bart


  4. #4
    Gary''s Student
    Guest

    Re: ClearContents of selected cell and cell validated as list/indi

    To clear everything to the right:
    Range(Selection, Selection.End(xlToRight)).ClearContents

    To clear the entire row:
    Selection.EntireRow.ClearContents


    Have a pleasant weekend!
    --
    Gary's Student


    "AA Arens" wrote:

    > Is there an Offset command that take a range of cells right of the
    > active cell?
    > I want to have the cells right of the active cell cleared, not only the
    > one right of it.
    >
    > And, related to this, is the a row-clear command? That clears all cells
    > left and right of the active cell (so far not protected and locked)?
    >
    >
    > Bart
    >
    >


  5. #5
    AA Arens
    Guest

    Re: ClearContents of selected cell and cell validated as list/indi

    To clear everything to the right:
    Range(Selection, Selection.End(xlToRight)).ClearContents

    To clear the entire row:
    Selection.EntireRow.ClearContents

    Thanks for the message.

    Surrounding the tale are cells protected. When I use both of your
    solutions, I get a message that protected cells cannot be modified. How
    to bypass this (so no modification, but also no message).

    A solution would be to have the focus automatically moved to the most
    left cell of the active row, and then use Entire Row or the fixed
    amount of cells to the right to be cleared.

    (I also add a new message for this problem)

    Bart


  6. #6
    Norman Jones
    Guest

    Re: ClearContents of selected cell and cell validated as list/indi

    Hi Bart,

    See response to your new thread.


    ---
    Regards,
    Norman



    "AA Arens" <[email protected]> wrote in message
    news:[email protected]...
    > To clear everything to the right:
    > Range(Selection, Selection.End(xlToRight)).ClearContents
    >
    > To clear the entire row:
    > Selection.EntireRow.ClearContents
    >
    > Thanks for the message.
    >
    > Surrounding the tale are cells protected. When I use both of your
    > solutions, I get a message that protected cells cannot be modified. How
    > to bypass this (so no modification, but also no message).
    >
    > A solution would be to have the focus automatically moved to the most
    > left cell of the active row, and then use Entire Row or the fixed
    > amount of cells to the right to be cleared.
    >
    > (I also add a new message for this problem)
    >
    > Bart
    >




+ 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