Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a union of a hundred cells similar to the line of code below.
set cell???? = range("??") Set allcell = Application.Union(cell1720, cell1721, cell1722) allcells.Value = "" allcells.Font.ColorIndex = 0 What is the syntax to unprotect all cells in "allcell" -- roypeck |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Roy,
allcells.Locked = False hth, Doug "Roy Peck" wrote in message ... Have a union of a hundred cells similar to the line of code below. set cell???? = range("??") Set allcell = Application.Union(cell1720, cell1721, cell1722) allcells.Value = "" allcells.Font.ColorIndex = 0 What is the syntax to unprotect all cells in "allcell" -- roypeck |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Entered "allcells.Locked = False" into the macro and got the following result
in Excell 2003. Run-time error'1004': Unable to set the Locked property of the Range class. -- roypeck "Doug Glancy" wrote: Roy, allcells.Locked = False hth, Doug "Roy Peck" wrote in message ... Have a union of a hundred cells similar to the line of code below. set cell???? = range("??") Set allcell = Application.Union(cell1720, cell1721, cell1722) allcells.Value = "" allcells.Font.ColorIndex = 0 What is the syntax to unprotect all cells in "allcell" -- roypeck |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Say this is in Sheet1. Try
Sheets("Sheet1").Unprotect allcells.locked = False Sheets("Sheet1").Protect If there is a password involved, you will need to supply it as a parameter to the protect/unprotect methods: Sheets("Sheet1").Unprotect("MyPassword") Hth -John Coleman On Mar 11, 9:18 am, Roy Peck wrote: Entered "allcells.Locked = False" into the macro and got the following result in Excell 2003. Run-time error'1004': Unable to set the Locked property of the Range class. -- roypeck "Doug Glancy" wrote: Roy, allcells.Locked = False hth, Doug "Roy Peck" wrote in message ... Have a union of a hundred cells similar to the line of code below. set cell???? = range("??") Set allcell = Application.Union(cell1720, cell1721, cell1722) allcells.Value = "" allcells.Font.ColorIndex = 0 What is the syntax to unprotect all cells in "allcell" -- roypeck- Hide quoted text - - Show quoted text - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tried the code as stand alone
got a run-time error 424: object required. Inserted the code at the end of the macro that defines "Allcells" as a union and got the same 1004 error. The following 2 lines of code do work in the same macro that defines "Allcells" allcells.Value = "" ' clear all cells allcells.Font.ColorIndex = 5 'set all cells to blue Excell 2003 Vesta. "Allcells" is over 100 cells, all of which are merged cells. Changing the protection cell by cell one at a time does work and is a workaround. The workaround is slow. Within nested Do loops Sheets("sheet1").range("b2").offset(I*5,J*5).selle ct Selection.Locked = False roypeck "Roy Peck" wrote: Have a union of a hundred cells similar to the line of code below. set cell???? = range("??") Set allcell = Application.Union(cell1720, cell1721, cell1722) allcells.Value = "" allcells.Font.ColorIndex = 0 What is the syntax to unprotect all cells in "allcell" -- roypeck |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unprotect in a macro | Excel Discussion (Misc queries) | |||
unProtect some cells on the spreadsheet | Excel Programming | |||
Union/Range/Cells | Excel Programming | |||
printing a union of non-contiguous cells- help! | Excel Programming | |||
printing a union of non-contiguous cells- help! | Excel Programming |