delete

How To Apply A Button To Clear Specific Cells In Excel



Sharing buttons:

hello everyone welcome to excel 10 tutorial in this tutorial I will show

you how to apply a button to clear a specific cell in Excel in short we are

creating a clear cell button inside Excel this is an advanced tutorial and

we will be using Excel VBA for this tutorial I am using Microsoft Excel 2010

for this demonstration let's get started now I have a result sheet here now these

are the numbers this is total and average and I want to clear this cell

whenever I click a button that should be right here so I want to click here on a

button and I want this cell to be cleared ok to do that lets create a

button here you should click on insert and click on shape like this one and

button text

so this is our Clear button okay now we have our button and we need visual basic

coding click on developer and click visual basic now with insert click module

now I'm going to need a code and I have already written here now copy and paste

don't worry you will get this code in the comment section make sure you copy

it from there now take a look at here here is the range of cells

I want to delete okay so first one is B 2 and B 7 I want to delete this column

so I'm going to write b2 here and in here

b7 so by this line I will clear this column now I'm going to select column C

D E okay so let's write it down C2 D2 E2 E7 D7

C7 okay so these are the line that is going to select these cells okay if

you need to add any more cell you can add it just simply copy it and repeat

okay now click Save click yes so our Visual Basic is saved now we are

going to assign a macro for this button so to do that I'm going to right click

on this button you click this assign macro okay now click clear cell then

click okay so our button is ready and when I click here in this button it's

supposed to delete this so let's see what happens

yes it's done and I clicked here and all these cells are deleted let's try it

again so these are the cell and now we're yes

it's clear so we have successfully applied a button inside Microsoft Excel

to clear a specific cell ok thanks for watching if this video was helpful give

it a thumbs up if you need any help with Microsoft Excel you can ask me in the

channel discussion section share this video with your friends and please do

subscribe it means everything to me this is kazi signing out from Excel 10

tutorial thank you