Clear cell multiple worksheets

k9lover

New Member
Joined
Jul 5, 2011
Messages
4
I have a workbook with about 50 sheets. I need to clear the value from cell B15 in every sheet in that workbook. Thank you in advance!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
The easiest way is to click on the first work sheet in the bottom left. Then click the >| button to move to the last sheet. Hold down the shift key and click the last sheet which selects all workbooks.

Click on B15 and push delete.

Since all sheets were highlighted, all sheets B15 will be cleared.

Can also be done with a macro if needed.

Code:
Sub ClearB15()
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
        ws.Range("B15").ClearContents
    Next ws
End Sub
 
Last edited:
Upvote 0
ALT+F11
Insert Menu
Choose "Module"
Copy and paste that CODE section.

Depending on the version of excel you'll access your macros and run it.

In 2003 and earlier I believe they're in the tools menu. in 2007 you need to go into the excel options and show developer tab on ribbon to access macros.

From there you can insert a button (Form control) and assign the macro to it so whenever you push that button it runs, or you can assign a keyboard shortcut.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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