Clear Specific Cells

dodokh

Board Regular
Joined
Sep 11, 2009
Messages
142
Hello,

How can I make a button to clear specific cells.

<TABLE style="WIDTH: 270pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=359><COLGROUP><COL style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 950" width=26><COL style="WIDTH: 48pt" span=2 width=64><COL style="WIDTH: 106pt; mso-width-source: userset; mso-width-alt: 5156" width=141><COL style="WIDTH: 48pt" width=64><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7 0.5pt solid; BACKGROUND-COLOR: #dce6f1; WIDTH: 20pt; HEIGHT: 15pt; BORDER-TOP: #95b3d7 0.5pt solid; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 height=20 width=26>
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: #dce6f1; WIDTH: 48pt; BORDER-TOP: #95b3d7 0.5pt solid; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 width=64>
A
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: #dce6f1; WIDTH: 48pt; BORDER-TOP: #95b3d7 0.5pt solid; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 width=64>
B
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: #dce6f1; WIDTH: 106pt; BORDER-TOP: #95b3d7 0.5pt solid; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 width=141>
C
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: #dce6f1; WIDTH: 48pt; BORDER-TOP: #95b3d7 0.5pt solid; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 width=64>
D
</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7 0.5pt solid; BACKGROUND-COLOR: #dce6f1; HEIGHT: 15pt; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 height=20>
1
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64>Landing</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64>Commercial Handling</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7 0.5pt solid; BACKGROUND-COLOR: #dce6f1; HEIGHT: 15pt; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 height=20>
2
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64>Parking</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64>Technical Handling</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7 0.5pt solid; BACKGROUND-COLOR: #dce6f1; HEIGHT: 15pt; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 height=20>
3
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64>Lighting</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7 0.5pt solid; BACKGROUND-COLOR: #dce6f1; HEIGHT: 15pt; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl65 height=20>
4
</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64>ATC</TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD><TD style="BORDER-BOTTOM: #95b3d7 0.5pt solid; BORDER-LEFT: #95b3d7; BACKGROUND-COLOR: transparent; BORDER-TOP: #95b3d7; BORDER-RIGHT: #95b3d7 0.5pt solid" class=xl64> </TD></TR></TBODY></TABLE>

I need to click the button to clear the cells B1, B2, B3, B4, D1, D2.

Thank in advance.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Create a button and add this code:
Code:
Sub Clear_Specific()
Range("B1:B4,D1:D2").ClearContents
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top