LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Code issue

Hi all,
I have a workbook with a fair amount of code written into it. I emailed
myself a copy of the workbook home on the weekend to work on it and kept
getting an error with one of the macros at home. I am (was) using the SAME
version of Excel - 2002 SP3 until I got completely frustrated and dropped the
$$$ for 2007 for my PC at home. Same problem.
The part of the code that is hanging is:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sh As Worksheet, sh1 As Worksheet
Dim rng As Range, Cell As Range
Set rng = Worksheets("Main").Range("C8:C17")
If Not Intersect(Target, rng) Is Nothing Then
For Each sh1 In Worksheets
ERROR --- bVisible = False
If LCase(sh1.Name) < "main" Then
For Each Cell In rng
Set sh = Nothing
On Error Resume Next
Set sh = Worksheets(Cell.Value)
On Error GoTo 0
If Not sh Is Nothing Then
If sh.Name = sh1.Name Then
bVisible = True
Exit For
End If
End If
Next Cell
If bVisible Then
sh1.Visible = xlSheetVisible
Else
sh1.Visible = xlSheetHidden
End If
End If
Next sh1
End If
End Sub

Any ideas on how to fix this issue? It seems that the same libraries /
add-ins are installed.

Thanks in advance,
Tom
 
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
Code Reference Issue J.W. Aldridge Excel Programming 5 August 24th 06 02:50 PM
Reliability issue with some code Dean[_9_] Excel Programming 0 March 25th 06 01:32 PM
Autofit code Issue Joe Excel Programming 0 December 20th 05 04:12 PM
Code compatibility issue iamrajy[_4_] Excel Programming 1 October 17th 05 07:32 PM
VBA Code issue scrabtree23[_3_] Excel Programming 2 December 4th 04 04:26 PM


All times are GMT +1. The time now is 11:49 PM.

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"