I have a workbook with 11 tabs, plus one at the beginning marked as "Start Here". I want to create one button in that tab that will clear up to 9 individual cells in each of these tabs. Is this possible and how is it done?
I have a workbook with 11 tabs, plus one at the beginning marked as "Start Here". I want to create one button in that tab that will clear up to 9 individual cells in each of these tabs. Is this possible and how is it done?
In the attached workbook please look for the procedure ClearCells_Click in the standard code module ClearCells. There you will find the line of code
Const CellsToClear As String = "A3 B17 C5 D7 E8"
This is where you can specify the cells you want to clear. It can be any number of cells, and you can specify ranges also, like D4:E5. Just make sure that each cell or range address is separated from the previous by a single space and there are no extra spaces in the specification.
The code will run when you click the button on Sheet 1. Actually, the name of Sheet1 is immaterial, as are the names of all other sheets. The cellls specified will be cleared on all sheets except the one on which the button resides. However, if you run the code from the VB Editor the excepted sheet will be the one which is active at the time of calling the code, which may not be the one with the button.