JustJerry2C
New Member
- Joined
- Aug 21, 2017
- Messages
- 16
I have some existing code that works exactly as it should:
What I can't seem to make work, is that I want three specific cells to NOT be deleted, or repopulated with existing values, those being cells B70, 71 and 72.
I tired this for starters trying to assign a temporary value, but it does not work
Any suggestions would greatly be appreciated!
VBA Code:
'Clear Vocab Entries
With Sheets(VocabSpell.Name)
Set rClear = Nothing
For Each r In Sheets(VocabSpell.Name).UsedRange
If r.Locked = False Then
If rClear Is Nothing Then
Set rClear = r
Else
Set rClear = Union(rClear, r)
End If
End If
Next r
rClear.ClearContents
End With
What I can't seem to make work, is that I want three specific cells to NOT be deleted, or repopulated with existing values, those being cells B70, 71 and 72.
I tired this for starters trying to assign a temporary value, but it does not work
VBA Code:
'Clear Vocab Entries
With Sheets(VocabSpell.Name)
TEMP=Range("B70").Value
Set rClear = Nothing
For Each r In Sheets(VocabSpell.Name).UsedRange
If r.Locked = False Then
If rClear Is Nothing Then
Set rClear = r
Else
Set rClear = Union(rClear, r)
End If
End If
Next r
rClear.ClearContents
Range("B70").Value = TEMP
End With
Any suggestions would greatly be appreciated!