Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheets.Unprotect not working
I've got the following macro tied to a dropdown box. It's a copy/paste
macro to move the chosen value to another cell, which is protected. For some reason, it's not unprotecting. I haven't a clue why... this seems so simple. There is no password and other macros are running fine on this same sheet. Sub DropDown43_Change() Sheets("Order").Unprotect ' CAPTURE Thickness Range("G4").Select Selection.Copy Range("IG_Unit_Thickness").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("F3").Select Sheets("Order").Protect End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheets.Unprotect not working
Nothing terribly off that I can see (assuming you have a sheet called Order).
Give this a whirl... Sub DropDown43_Change() with Sheets("Order") .Unprotect ' CAPTURE Thickness .Range("G4").Value = .Range("IG_Unit_Thickness").Value .Protect End With End Sub -- HTH... Jim Thomlinson "mike" wrote: I've got the following macro tied to a dropdown box. It's a copy/paste macro to move the chosen value to another cell, which is protected. For some reason, it's not unprotecting. I haven't a clue why... this seems so simple. There is no password and other macros are running fine on this same sheet. Sub DropDown43_Change() Sheets("Order").Unprotect ' CAPTURE Thickness Range("G4").Select Selection.Copy Range("IG_Unit_Thickness").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("F3").Select Sheets("Order").Protect End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheets.Unprotect not working
Everything's happening on the same sheet. The With format doesn't work
either. I did narrow it down to the specific cell that's causing it. It's the target cell of the dropdown box, where the choice is put. At this point, I've left it unlocked as it just won't unprotect it. I'm thinking the dropdown box performs the input to the target cell before Excel realizes it's a macro, therefore coming to a halt due to protection before the macro has a chance to unprotect it. Sound logical? It's the only thing I can think of and seems like a sortof goofy thing if it's true. On Oct 10, 3:12 pm, "Don Guillett" wrote: It could be that you are unprotecting the COPY sheet instead of the DESTINATION sheet. Sub dovalue() With Sheets("sheet4")'Destination sheet .Unprotect .Range("a1").Value = _ Sheets("sheet3").Range("a2").Value .Protect End With End Sub -- Don Guillett SalesAid Software "mike" wrote in ooglegroups.com... I've got the following macro tied to a dropdown box. It's a copy/paste macro to move the chosen value to another cell, which is protected. For some reason, it's not unprotecting. I haven't a clue why... this seems so simple. There is no password and other macros are running fine on this same sheet. Sub DropDown43_Change() Sheets("Order").Unprotect ' CAPTURE Thickness Range("G4").Select Selection.Copy Range("IG_Unit_Thickness").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("F3").Select Sheets("Order").Protect End Sub- Hide quoted text -- Show quoted text - |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheets.Unprotect not working
Send your workbook if desired.
Instead of this CAPTURE Thickness Range("G4").Select Selection.Copy Range("IG_Unit_Thickness").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("F3").Select ======== you may use JUST this without ANY of the other. NO selections. Range("IG_Unit_Thickness").value= Range("G4").value -- Don Guillett SalesAid Software "mike" wrote in message ups.com... Everything's happening on the same sheet. The With format doesn't work either. I did narrow it down to the specific cell that's causing it. It's the target cell of the dropdown box, where the choice is put. At this point, I've left it unlocked as it just won't unprotect it. I'm thinking the dropdown box performs the input to the target cell before Excel realizes it's a macro, therefore coming to a halt due to protection before the macro has a chance to unprotect it. Sound logical? It's the only thing I can think of and seems like a sortof goofy thing if it's true. On Oct 10, 3:12 pm, "Don Guillett" wrote: It could be that you are unprotecting the COPY sheet instead of the DESTINATION sheet. Sub dovalue() With Sheets("sheet4")'Destination sheet .Unprotect .Range("a1").Value = _ Sheets("sheet3").Range("a2").Value .Protect End With End Sub -- Don Guillett SalesAid Software "mike" wrote in ooglegroups.com... I've got the following macro tied to a dropdown box. It's a copy/paste macro to move the chosen value to another cell, which is protected. For some reason, it's not unprotecting. I haven't a clue why... this seems so simple. There is no password and other macros are running fine on this same sheet. Sub DropDown43_Change() Sheets("Order").Unprotect ' CAPTURE Thickness Range("G4").Select Selection.Copy Range("IG_Unit_Thickness").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Application.CutCopyMode = False Range("F3").Select Sheets("Order").Protect End Sub- Hide quoted text -- Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unprotect not working | Excel Programming | |||
unprotect sheets | Excel Worksheet Functions | |||
Protect/Unprotect Not Working | Excel Programming | |||
Protect/Unprotect w/ VBA not working as supposed... | Excel Programming | |||
Unprotect not working | Excel Programming |