Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There,
Is is possible to copy the locked status of a cell? Situation: - I have a cell locked - I have my sheet protected - I run a macro to copy the locked cell and pasting it afterwards = The pasted cell does not inherit the locked status! Is it possible to inherit this status as well? Or is the way to go: Unlock sheet ...copy ..paste ..lock again? I am sure Bob Phillips will recognise some of the code ;o))) Sub Check_Usedrange() Dim lngLastRow As Long, lngLastCol As Long, j As Long On Error Resume Next lngLastRow = 1 With ActiveSheet.UsedRange lngLastRow = .Find("*", .Cells(1), xlFormulas, xlWhole, xlByRows, xlPrevious).Row .Rows(lngLastRow).Copy .Rows(lngLastRow + 1).PasteSpecial Paste:=xlPasteFormats .Rows(lngLastRow + 1).PasteSpecial Paste:=xlPasteFormulas For j = 1 To .Cells(lngLastRow + 1, Columns.Count).End(xlToLeft).Column If Not .Cells(lngLastRow + 1, j).HasFormula Then .Cells(lngLastRow + 1, j).ClearContents End If Next j End With End Sub Thanks for assisting once again, Sige |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and paste a formula in a locked cell | Excel Discussion (Misc queries) | |||
Copy data from the Status Bar | Excel Worksheet Functions | |||
Status Bar sum value copy to spreadsheet | Excel Discussion (Misc queries) | |||
Copy Status bar macro | Excel Discussion (Misc queries) | |||
How can user move in locked worksheet but not copy cell contents? | Excel Worksheet Functions |