How do I delete selected cell when using check box

  • Thread starter Thread starter cmlm
  • Start date Start date
C

cmlm

I have data in rows A17:J500 with check boxes in rows J17:J500
By activating a macro in A10 I want to clear contents of selecte
rows.

Thank you
 
Use

Range("A17:J500").ClearContents

How do you activate the macro in A10, by selecting A10?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$10" Then
Application.DisplayAlerts = False
Range("A17:J500").ClearContents
Application.DisplayAlerts = True
End If
End Sub


--


No private emails please, for everyone's
benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
:confused:

Peo Sjoblom

Thanks for your reply. First of all, my appologies, but I did not sen
a private e-mail as far as I know. Am I doing something wrong, I wen
to new thread and posted it. Also what does the sealed envelope with
black dot mean.

Now, refrasing my origanal question.

I have data in rows A17:F500

I need to mark specific rows once the data is no longer needed.

The contents of these rows (the rows which have been marked) must b
cleared weekly.

I would like to clear the contents of these rows simultaneausly using
macro.


Thank you
 
First, this was (I changed it now) part of my signature to trying to avoid
getting
private emails, it was not directed to you but in general stating that I
won't reply to private emails.
I have changed it so it below my name to avoid misunderstandings

Ok, do as follows, select a range of cells anywhere, do tools>macro>record
new macro, this workbook,
click OK. Now with the cells still selected do edit>clear>clear contents.
Stop the macro recording.
Now do view>toolbars>forms and select the command button and drag it to cell
where you want it, when you release the mouse button
it will ask you to assign macro, select the one you recorded, click OK.
Select a few cells and click the button




--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Back
Top