Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Box around selected range

I suspect you are setting the userinterfaceonly property of the sheets in
the workbook_open event. I have found if you set protection on a sheet in
workbook_open when the sheet is not active, you get this type of behavior

Try

set sh1 = activeSheet
Application.ScreenUpdating = False
for each sh in thisWorkbook.Worksheets
sh.Activate
sh.Protect UserInterfaceOnly:=True ' other options
Next
sh1.activate
Application.ScreenUpdating = True

--
Regards,
Tom Ogilvy

Terry von Gease wrote in message
...
What could happen to cause the frame around the currently selected range

on
a sheet to not appear? The sheet behaves normally if you mouse, tab, or
what-have-you to an unlocked cell or range in that the cell address in the
formula bar is correct for where you are but no frame appears

This seems to affect any or all sheets in a workbook form time to time.
Mostly more than less. All of the sheets feature small ranges of unlocked
cells and are all in protected mode with only the ability to select

unlocked
cells. The sheets are protected with UserInterfaceOnly:=True

If you manually unprotect any of the sheets and then manually protect them
again the problem goes away. The box around the selection functions

exactly
as it should. If you free up the selection highlight on all the sheets and
save the workbook the next time you open it the selection highlight once
more isn't working properly.

I'm sure I'm setting up something wrong somewhere, there's lots of code
invoked at WorkBook_Open time that diddles the various sheets but it's
unclear just what is causing this.

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Box around selected range

You're exactly right. In fact, with other than trivial variation in naming,
the loop you presented is identical with the loop I was using except for the
Activate.

Thanks, I do appreciate it.

Are there many of these little anomalies that can leap out of the canebrake
and bite you on the ass?

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley

"Tom Ogilvy" wrote in message
...
I suspect you are setting the userinterfaceonly property of the sheets in
the workbook_open event. I have found if you set protection on a sheet in
workbook_open when the sheet is not active, you get this type of behavior

Try

set sh1 = activeSheet
Application.ScreenUpdating = False
for each sh in thisWorkbook.Worksheets
sh.Activate
sh.Protect UserInterfaceOnly:=True ' other options
Next
sh1.activate
Application.ScreenUpdating = True

--
Regards,
Tom Ogilvy

Terry von Gease wrote in message
...
What could happen to cause the frame around the currently selected range

on
a sheet to not appear? The sheet behaves normally if you mouse, tab, or
what-have-you to an unlocked cell or range in that the cell address in

the
formula bar is correct for where you are but no frame appears

This seems to affect any or all sheets in a workbook form time to time.
Mostly more than less. All of the sheets feature small ranges of

unlocked
cells and are all in protected mode with only the ability to select

unlocked
cells. The sheets are protected with UserInterfaceOnly:=True

If you manually unprotect any of the sheets and then manually protect

them
again the problem goes away. The box around the selection functions

exactly
as it should. If you free up the selection highlight on all the sheets

and
save the workbook the next time you open it the selection highlight once
more isn't working properly.

I'm sure I'm setting up something wrong somewhere, there's lots of code
invoked at WorkBook_Open time that diddles the various sheets but it's
unclear just what is causing this.

--
Terry

"I said I never had much use for one,
I never said I didn't know how to use one."
M. Quigley






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
How to write (Selected range - 1) Damian Excel Discussion (Misc queries) 2 September 4th 09 08:20 PM
how to add 130% to a selected range of numbers ? MATHIMATICALLY IMPAIRED Excel Discussion (Misc queries) 4 January 14th 09 05:22 PM
Setting var to selected Range El Bee Excel Discussion (Misc queries) 2 January 18th 08 09:31 PM
Reclaculating a selected range [email protected] Excel Discussion (Misc queries) 3 March 23rd 06 08:43 AM
delete every nth row in selected range cwinters Excel Discussion (Misc queries) 1 July 6th 05 08:17 PM


All times are GMT +1. The time now is 08:57 AM.

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"