Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all
I have this sub below that I use, It works very well apart from one small thing. I would like to have a password in it. Also I need to be able to change the font colour and make bold etc. I have tryed adding it to the sub but it wont work, as the sub is now it works but users can go to the protection in tools and unprotect. If I add a password to the sheet I cant use the macro. Please help Regards Chris Sub InsertRowsSASDeck() Dim ar As Long If Selection.Interior.ColorIndex < 36 _ Or Selection.Count 1 Then Exit Sub ActiveSheet.Unprotect ar = ActiveCell.Row Selection.EntireRow.Insert Cells(ar, "d").Formula = "=a" & ar & "*b" & ar & "" Cells(ar, "i").Formula = "=a" & ar & "*e" & ar & "" Cells(ar, "j").Formula = "=a" & ar & "*f" & ar & "" Cells(ar, "k").Formula = "=a" & ar & "*g" & ar & "" ActiveSheet.Protect _ DrawingObjects:=True, _ Contents:=True, _ Scenarios:=True, _ AllowFormattingCells:=True, _ AllowFormattingColumns:=True, _ AllowFormattingRows:=True, _ AllowInsertingRows:=False, _ AllowInsertingHyperlinks:=True, _ AllowSorting:=True, _ AllowFiltering:=True, _ AllowUsingPivotTables:=True End Sub Sub DeleteRowsSASdeck() If Selection.Interior.ColorIndex < 36 Then Exit Sub ActiveSheet.Unprotect Selection.EntireRow.Delete ActiveSheet.Protect _ DrawingObjects:=True, _ Contents:=True, _ Scenarios:=True, _ AllowFormattingCells:=True, _ AllowFormattingColumns:=True, _ AllowFormattingRows:=True, _ AllowInsertingRows:=False, _ AllowInsertingHyperlinks:=True, _ AllowSorting:=True, _ AllowFiltering:=True, _ AllowUsingPivotTables:=True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro that will change the font of a cell if i change a value | Excel Discussion (Misc queries) | |||
change scaling % but font size didnt change porportionally, pls he | Excel Discussion (Misc queries) | |||
Change all text one font size up with various font sizes used. | New Users to Excel | |||
Highlight entire document and try to change font - won't change. | Excel Discussion (Misc queries) | |||
change display font to actual selected font | Excel Discussion (Misc queries) |