LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 97 error

I wrote this macro in Excel 2002. And the co-workers that
are using it are running excel 97 and they get the
following error:
Copile Error; Sub or Function not defined.
Here is the code:


Sub LoadFactor()
Dim kWh As Range
Dim Demand As Range
Dim Days As Range
Dim Factor As Range
Set kWh = Worksheets("Customer").Range("G7:G100")
Set Demand = Worksheets("Customer").Range("H7:H100")
Set Days = Worksheets("Customer").Range("K7:K100")
Set Factor = Worksheets("Customer").Range("M7:M100")
Factor.ClearContents
' For Loop for Calculation
For i = 1 To kWh.Cells.Count
If kWh.Cells(i) < "" And Demand.Cells(i) < 0 And
Days.Cells(i) < 0 Then
LF = Round(kWh.Cells(i) / (Demand.Cells(i) *
Days.Cells(i) * 24), 2)
Factor.Cells(i) = LF
End If
If Demand.Cells(i) = 0 And Demand.Cells(i) < ""
Then
Factor.Cells(i) = "0.00"
End If
If kWh.Cells(i) = "" And Demand.Cells(i) = "" And
Days.Cells(i) = "" Then
Factor.Cells(i) = ""
End If
If Days.Cells(i) = 0 And Days.Cells(i) < "" Then
Factor.Cells(i) = "0.00"
End If
Next i
' Formatting Columns and Application
Worksheets("Customer").Range("M7:M100").NumberForm at
= "0.00"


Thanks for the help.
 
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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 06:44 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"