PC Review


Reply
Thread Tools Rate Thread

ClearContents of selected cell and cell validated as list/indirect

 
 
AA Arens
Guest
Posts: n/a
 
      13th May 2006
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      13th May 2006
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
>
>

 
Reply With Quote
 
AA Arens
Guest
Posts: n/a
 
      13th May 2006
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

 
Reply With Quote
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      13th May 2006
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
>
>

 
Reply With Quote
 
AA Arens
Guest
Posts: n/a
 
      14th May 2006
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 With Quote
 
Norman Jones
Guest
Posts: n/a
 
      14th May 2006
Hi Bart,

See response to your new thread.


---
Regards,
Norman



"AA Arens" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
sum cells based on contents of adjacent cell (validated list)? Casi12 Microsoft Excel Worksheet Functions 3 29th Apr 2008 03:31 PM
A validated List which link to selected cells according to what is selected on the list WL Microsoft Excel Worksheet Functions 1 5th Jun 2006 09:52 PM
cell data not validated if navigating cell to cell with mouse =?Utf-8?B?TG92ZVRoYXRNb3VzZQ==?= Microsoft Excel Worksheet Functions 6 21st May 2006 10:03 PM
Validated List Cell enters data into other cell jeff Microsoft Excel Misc 2 24th Apr 2004 03:12 AM
Protecting a validated list cell Mike S. Microsoft Excel Misc 1 18th Mar 2004 07:37 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:25 PM.