Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2007

Tip: Looking for answers? Try searching our database.

format cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kevin carter - 20 Dec 2007 11:22 GMT
Hi,
I have a worksheet that accepts a user input in the range Ac5:ac200
what i want to do is check if a cell has the value "C" in the above
range
if it does i want to
   1   Turn the cell Green
   2   Lock the cell range X5:x200
           for example  if cell ac10 = c
               cell ac10 turns green
               cell x10 locks for editing

how can i do this with VB?

Thanks
Dan R. - 20 Dec 2007 14:59 GMT
Sub test()
  For Each cell In ActiveSheet.Range("AC5:AC200")
     If cell = "C" Then
        cell.Interior.ColorIndex = 4
        cell.Offset(, -5).Locked = True
     End If
  Next cell
End Sub

--
Dan

> Hi,
> I have a worksheet that accepts a user input in the range Ac5:ac200
[quoted text clipped - 10 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.