View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How do I access each cell in a range

Dim cell As Range
On Error Resume Next
For Each cell In ActiveSheet.UsedRange
cell.ClearContents
Next cell
On Error GoTo 0


--

HTH

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


"Grandma Barb" <Grandma wrote in message
...
I have a workbook set up to use in a classroom setting with multiple

choice
answers. I have unlocked the answer boxes and protected the sheet. All
works nicely. Now I would like to have each student remove their answers
leaving the workbook for the next student. Before the protection I used a
macro selecting a range of cells in the answer columns and clearing the
cells. How can I move down the range and clear only the unlocked cells?