Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unprotect not working bobwilson[_14_] Excel Programming 2 April 3rd 06 07:41 PM
unprotect sheets BC@D Excel Worksheet Functions 1 November 25th 05 02:57 PM
Protect/Unprotect Not Working nospaminlich Excel Programming 1 November 3rd 05 06:59 PM
Protect/Unprotect w/ VBA not working as supposed... HBj Excel Programming 3 October 7th 05 05:16 PM
Unprotect not working Stuart[_5_] Excel Programming 2 May 10th 04 07:18 PM


All times are GMT +1. The time now is 05:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"