Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help Clear Function

Hv a Excel file with 3 sheets for calculation of various charges..On each
sheet, most of the cells are protected against changes because of built-in
functions and formulas. A minority of these cells are NOT protected as they
require users' input. Since these sheets are re-used often, is there anyway
to write a VBA string for a button option to clear these entries everytime
Excel starts up? The button should ideally work for each sheet only. Any
help would be appreciated. Thanks in adv.

Ed.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help Clear Function

Sub Demo()
with Worksheets("Sheet8")
.Range("A2,B9:B15,C12,A13,F1:F10").ClearContents
End with
End Sub

Assign the macro to your button for Sheet8

--
regards,
Tom Ogilvy

"Ed" wrote in message
...
Hv a Excel file with 3 sheets for calculation of various charges..On each
sheet, most of the cells are protected against changes because of built-in
functions and formulas. A minority of these cells are NOT protected as

they
require users' input. Since these sheets are re-used often, is there

anyway
to write a VBA string for a button option to clear these entries everytime
Excel starts up? The button should ideally work for each sheet only. Any
help would be appreciated. Thanks in adv.

Ed.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help Clear Function

Sub ClearCells()
Dim cell As Range
With ActiveSheet
For Each cell In .UsedRange
If Not cell.Locked Then
cell.ClearContents
End If
Next cell
End With
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ed" wrote in message
...
Hv a Excel file with 3 sheets for calculation of various charges..On each
sheet, most of the cells are protected against changes because of built-in
functions and formulas. A minority of these cells are NOT protected as

they
require users' input. Since these sheets are re-used often, is there

anyway
to write a VBA string for a button option to clear these entries everytime
Excel starts up? The button should ideally work for each sheet only. Any
help would be appreciated. Thanks in adv.

Ed.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i clear a perticular range using a function...??? Saleem Hyder Excel Discussion (Misc queries) 1 September 13th 09 07:09 PM
clear the clear the web page email attachment lines MCrider Excel Discussion (Misc queries) 0 November 11th 07 10:05 PM
Function to clear data Renee Nguy Excel Discussion (Misc queries) 0 April 24th 06 03:33 PM
Clear Cell If Function = 0 Geno Excel Worksheet Functions 4 March 13th 06 01:59 AM
How Do I Install a Reset or Clear Function CC Excel Worksheet Functions 4 February 10th 05 10:06 PM


All times are GMT +1. The time now is 06:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"