Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I'm trying to use FOR - NEXT to cycle through the Range B:B or even better go to the last row (which I don't know how to do successfully - it always stops short a few rows). I would like to find each cell that has an "X" and then lock that row or if no "X" leave it unlock. I have the entire worksheet unlock - so when this runs the only locked rows are the ones with an "X" in Column B. Here is my code so far, it locks cell A1 and that's it: Sub LockCells() Dim test1 As Range Set test1 = Range("B2, B150") For Each test1 In Selection If test1 = "" Then ActiveCell.Locked = False ActiveCell.FormulaHidden = False Else ActiveCell.Locked = True ActiveCell.FormulaHidden = True End If Next End Sub Many Thanks!! Dave |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
sum cells that meet a specific condition | Excel Worksheet Functions | |||
Excel-only average cells if two cells in same row, meet two condit | Excel Worksheet Functions | |||
Count Cells that meet Criteria | Excel Worksheet Functions | |||
I want to know how many times 2 corresponding cells meet a conditi | Excel Discussion (Misc queries) | |||
Adding cells that meet certain criteria | Excel Programming |