Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time error 13 between Win NT and Win 2000
The error occurs on this line ...
If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date, 1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" & weeknum (Date, 1) Then The Date_Range refers to "='30-31'!$B$3:$B$17", where 30- 31 is the particular sheet I was on when selecting the specific range. I would like for the Date_Range to appear on every sheet. How would that be accomplished? The word 'Missing' does not appear in the VBE-References checked. The only machine that this code currently works is the machine the code was created on. Any other machine I get the type mismatch error. TIA. BR, Antje Crawford From: Tom Ogilvy Date Posted: 7/29/2003 10:28:00 AM In the VBE, Look in tools=references and make sure no references are shown as MISSING. Also, what line is highlighted when you get the error message. Does Date_Range appear on every sheet? Regards, Tom Ogilvy "Antje Crawford" wrote in message ... Hello, I created the code below for the Workbook_Open event: The problem I have is that when I run this code on a Windows NT 4.0 machine it works without any errors, but if it is run on a Windows 2000 machine the run-time error 13: type mismatch occurs. Here is the code ... Private Sub Workbook_Open() Dim cell As Range Dim wsh As Worksheet For Each wsh In Worksheets 'Find worksheet for current period If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date, 1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" & weeknum (Date, 1) Then wsh.Activate 'Loop through cells to highlight current date For Each cell In Range("Date_Range") If cell.Value = Date Then cell.Font.Color = RGB(255, 0, 0) End If Next cell End If Next wsh End Sub Any suggestions? All help is greatly appreciated. TIA. BR, Antje Crawford |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time error 13 between Win NT and Win 2000
You need to install the Analysis toolpack to use the
Weeknum function. Simply select Tools/Add Ins from the menu, and check Analysis Toolpak in the list. You might need the installation CD. -----Original Message----- The error occurs on this line ... If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date, 1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" & weeknum (Date, 1) Then The Date_Range refers to "='30-31'!$B$3:$B$17", where 30- 31 is the particular sheet I was on when selecting the specific range. I would like for the Date_Range to appear on every sheet. How would that be accomplished? The word 'Missing' does not appear in the VBE-References checked. The only machine that this code currently works is the machine the code was created on. Any other machine I get the type mismatch error. TIA. BR, Antje Crawford From: Tom Ogilvy Date Posted: 7/29/2003 10:28:00 AM In the VBE, Look in tools=references and make sure no references are shown as MISSING. Also, what line is highlighted when you get the error message. Does Date_Range appear on every sheet? Regards, Tom Ogilvy "Antje Crawford" wrote in message ... Hello, I created the code below for the Workbook_Open event: The problem I have is that when I run this code on a Windows NT 4.0 machine it works without any errors, but if it is run on a Windows 2000 machine the run-time error 13: type mismatch occurs. Here is the code ... Private Sub Workbook_Open() Dim cell As Range Dim wsh As Worksheet For Each wsh In Worksheets 'Find worksheet for current period If wsh.Name = weeknum(Date, 1) & "-" & weeknum(Date, 1) + 1 Or wsh.Name = weeknum(Date, 1) - 1 & "-" & weeknum (Date, 1) Then wsh.Activate 'Loop through cells to highlight current date For Each cell In Range("Date_Range") If cell.Value = Date Then cell.Font.Color = RGB(255, 0, 0) End If Next cell End If Next wsh End Sub Any suggestions? All help is greatly appreciated. TIA. BR, Antje Crawford . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2000 copy error | Excel Discussion (Misc queries) | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Solver error with Excel 2000? | Excel Programming | |||
XP vs 2000 macro error | Excel Programming |