ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   clear contiguous fields with one keystroke (https://www.excelbanter.com/excel-programming/401197-clear-contiguous-fields-one-keystroke.html)

marshall

clear contiguous fields with one keystroke
 
Excel 2003 Using spreadsheet in modeling application. Need to reenter 14
new parameters frequently. They are contiguous. Would like to hit one key
and have all input fields reset to blank or zero.

Dave Peterson

clear contiguous fields with one keystroke
 
You could drop a button from the Forms toolbar on the worksheet that has a macro
assigned to it.

Option Explicit
Sub ClearZeroCells()
with activesheet
.range("a1,b9,c3:c5").clearcontents
.range("a3,b12,d1:d5").value = 0
end with
end sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Marshall wrote:

Excel 2003 Using spreadsheet in modeling application. Need to reenter 14
new parameters frequently. They are contiguous. Would like to hit one key
and have all input fields reset to blank or zero.


--

Dave Peterson


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com