![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
Could you tell me how to use Range(aRange).SpecialCells Method to select the unlocked cells in range aRange.
Thx |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
First, the sheet must be unprotected.
Then, record a macro to get the correct syntax. Replace the recorded range with aRange |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
Sorry, i didn't get you.
But how can i record Macro to select special cells whose locked property is false ? The Macro will only return the exact cells "B1, C2, "... But not SpecialCells... |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Quote:
property of a cell is not avail via specialcells....so you will have to loop through the range object and test for locked eg Dim Rg As Range Dim oCell As Range Set Rg = Range("A1:B11") For Each oCell In Rg If oCell.Locked = False Then MsgBox oCell.Address 'do your thing End If Next Ivan |
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Singapore
Posts: 77
|
regards Andrew XJ |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|