Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old July 12th 06, 03:48 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 16
Default If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct?

Marc



  #2   Report Post  
Old July 12th 06, 03:53 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 5,302
Default If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct?

Hi Marc,

Try:

Activesheet.Unprotect

'Your code

Activesheet.Protect


---
Regards,
Norman



"Marc" wrote in message
nk.net...
Marc




  #3   Report Post  
Old July 12th 06, 04:10 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 25
Default If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct?

I believe you are correct, but there are other options.

Take for instance... you can have your macro unprotect your sheet - run your macro - and then reprotect your sheet.

Sub MyMacro()
Dim Password 'This line of code is optional
Password = "1234"
ActiveSheet.Unprotect Password

~~ Your macro code goes here ~~

ActiveSheet.Protect Password, True, True, True
End Sub

--
Mark Ivey
"Marc" wrote in message nk.net...
Marc




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
Macro to update a column in a work based on another work sheet WickerMan New Users to Excel 1 December 4th 09 12:58 PM
2007 excel work sheet will not allow to insert rows or columns David Excel Discussion (Misc queries) 1 January 24th 09 07:30 PM
protected work sheet jinge Excel Discussion (Misc queries) 1 December 27th 08 10:29 PM
Protected work sheet Stuart Carnachan Excel Discussion (Misc queries) 0 August 30th 06 03:48 PM
Macro protected work sheet Henry Excel Programming 1 March 14th 06 11:35 PM


All times are GMT +1. The time now is 09:59 PM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017