Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I access each cell in a range

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?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I access each cell in a range

Thanks. I replaced the 11 with "" (quotes), copied the for next loop into my
macro and it worked. Now I don't have to worry about little fingers messing
up my excel sheet which lets the children in my Sunday School class work on
their Bible knowledge. Grandma Barb


"Don Guillett" wrote:

try this

Sub chgunlocked()
For Each c In Selection
If c.Locked = False Then c.Value = 11
Next
End Sub


--
Don Guillett
SalesAid Software

"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?




  #5   Report Post  
Posted to microsoft.public.excel.programming
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?





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
Limit access to range of cells jvs Excel Worksheet Functions 1 November 10th 09 09:37 AM
Link to Access & Named Range Jessica Excel Worksheet Functions 11 July 10th 09 02:34 PM
Excel data range to access Mark Links and Linking in Excel 1 September 12th 08 08:19 AM
Restricting access to a range of cells anandmr65 Excel Discussion (Misc queries) 1 July 26th 06 12:49 PM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM


All times are GMT +1. The time now is 07:23 AM.

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

About Us

"It's about Microsoft Excel"