Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macros Help Needed, Thanks in Advance

I have an Excel workbook with approximately 50 worksheets; I have been able
to enter into the VBA the following a) automatically name worksheets, b) sort
worksheets by name,and c) utilizing uppercase characters in specified areas.

My problem is with the first worksheet, which is a master inventory sheet, I
created a macro and appropriately used the shortcut "Ctrl A"; the Macro works
perfectly when the sheet is unprotected; the problems begin when I lock all
the sheets, for obvious reasons, then I get a message error.

Is there a way to by-pass this; I cannot leave the workbook unprotected, too
many issues will be created.

Thank you for all of your thoughts.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Macros Help Needed, Thanks in Advance

The first thing your macro should do it protect all the sheets with the
parameter "userinterfaceonly" set to true. That way, you're marking the
sheets as protected, but NOT for VBA stuff.
Alternatively, you can have the macro unprotect before it starts &
reprotects when it's done.
Bob Umlas
Excel MVP

"chris felix" wrote in message
...
I have an Excel workbook with approximately 50 worksheets; I have been
able
to enter into the VBA the following a) automatically name worksheets, b)
sort
worksheets by name,and c) utilizing uppercase characters in specified
areas.

My problem is with the first worksheet, which is a master inventory sheet,
I
created a macro and appropriately used the shortcut "Ctrl A"; the Macro
works
perfectly when the sheet is unprotected; the problems begin when I lock
all
the sheets, for obvious reasons, then I get a message error.

Is there a way to by-pass this; I cannot leave the workbook unprotected,
too
many issues will be created.

Thank you for all of your thoughts.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Macros Help Needed, Thanks in Advance

Bob:

This is new to me. I checked it out, and I probably should have been using
this option for some of my applications. Seems like there is always
something to learn!!!

--
Rich Locus
Logicwurks, LLC


"Bob Umlas" wrote:

The first thing your macro should do it protect all the sheets with the
parameter "userinterfaceonly" set to true. That way, you're marking the
sheets as protected, but NOT for VBA stuff.
Alternatively, you can have the macro unprotect before it starts &
reprotects when it's done.
Bob Umlas
Excel MVP

"chris felix" wrote in message
...
I have an Excel workbook with approximately 50 worksheets; I have been
able
to enter into the VBA the following a) automatically name worksheets, b)
sort
worksheets by name,and c) utilizing uppercase characters in specified
areas.

My problem is with the first worksheet, which is a master inventory sheet,
I
created a macro and appropriately used the shortcut "Ctrl A"; the Macro
works
perfectly when the sheet is unprotected; the problems begin when I lock
all
the sheets, for obvious reasons, then I get a message error.

Is there a way to by-pass this; I cannot leave the workbook unprotected,
too
many issues will be created.

Thank you for all of your thoughts.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macros Help Needed, Thanks in Advance


How would I go about marking my sheets set to true for "userinterfaceonly" ?
I appreciate your time as well and thank you for your expertise.

Chris
"Bob Umlas" wrote:

The first thing your macro should do it protect all the sheets with the
parameter "userinterfaceonly" set to true. That way, you're marking the
sheets as protected, but NOT for VBA stuff.
Alternatively, you can have the macro unprotect before it starts &
reprotects when it's done.
Bob Umlas
Excel MVP

"chris felix" wrote in message
...
I have an Excel workbook with approximately 50 worksheets; I have been
able
to enter into the VBA the following a) automatically name worksheets, b)
sort
worksheets by name,and c) utilizing uppercase characters in specified
areas.

My problem is with the first worksheet, which is a master inventory sheet,
I
created a macro and appropriately used the shortcut "Ctrl A"; the Macro
works
perfectly when the sheet is unprotected; the problems begin when I lock
all
the sheets, for obvious reasons, then I get a message error.

Is there a way to by-pass this; I cannot leave the workbook unprotected,
too
many issues will be created.

Thank you for all of your thoughts.


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 342
Default Macros Help Needed, Thanks in Advance

I would build in language to unprotect the worksheet, then perform the rest
of your macro, then reprotect the worksheet.

Languange like:

Activesheet.protect

and

Activesheet.unprotect

You can get more specific about the types of protection, the VB help will
explain the details.

Tom


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Macros Help Needed, Thanks in Advance

Good call, Tom!!
I use this procedure in some of my applications where I have to unprotect,
do what I need to do, then protect. I even assign a password when I protect
:)
--
Rich Locus
Logicwurks, LLC


"tompl" wrote:

I would build in language to unprotect the worksheet, then perform the rest
of your macro, then reprotect the worksheet.

Languange like:

Activesheet.protect

and

Activesheet.unprotect

You can get more specific about the types of protection, the VB help will
explain the details.

Tom

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macros Help Needed, Thanks in Advance

Appreciate your time, a little new at all of this so apologize in advance for
questions. When I run the macro I get the error, if I "debug" from there, is
this where I input the language you propose and if so where do I put the
password in.

I have copied my macro for you to look at and advise and again I thank you
for sharing your expertise.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 9/22/2009 by
'
' Keyboard Shortcut: Ctrl+b
'
Range("A5:B107").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

2. As long as I am here, can you explain why some of my VBA programs will
not work in my workbook when I have another workbook open; I placed similar
VBA info into each? And is there a way to separate this.

"tompl" wrote:

I would build in language to unprotect the worksheet, then perform the rest
of your macro, then reprotect the worksheet.

Languange like:

Activesheet.protect

and

Activesheet.unprotect

You can get more specific about the types of protection, the VB help will
explain the details.

Tom

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
Event Macros Help Needed edo Excel Discussion (Misc queries) 6 February 26th 09 09:55 PM
Help needed with Modifying 2 Macros DaveM[_2_] Excel Programming 4 June 26th 08 02:12 PM
How to extend spreadsheet as needed, not in advance Edward[_2_] New Users to Excel 1 September 28th 07 01:47 PM
Working with Macros - Help needed!!! The Greek Excel Discussion (Misc queries) 2 November 19th 06 05:39 PM
macros help needed Maria.N[_2_] Excel Programming 2 July 25th 06 01:48 PM


All times are GMT +1. The time now is 05:32 AM.

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

About Us

"It's about Microsoft Excel"