Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50103

Clear All of The Unlocked Cells Except 1 Particular Cells

$
0
0
Hi All,

i got this code from Google,
Code:

Sub ClearUnlockedCells()
 
    Dim wks As Worksheet
 
    For Each wks In ThisWorkbook.Worksheets
        On Error Resume Next
        wks.UsedRange.Value = vbNullString
        Err.Clear: On Error GoTo -1: On Error GoTo 0
    Next wks
 
    Set wks = Nothing
 
End Sub

For 1 and only particular cell on sheet(1), H1. Is there any possibilities to change the code above without clearing my cell,H1?
Or i need to name the range for all of the worksheets? It seems like nightmare for me to do so, on all 14sheets.

Hope to get advise from all of the guru here.

Viewing all articles
Browse latest Browse all 50103

Trending Articles