ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 97 error (https://www.excelbanter.com/excel-programming/304407-excel-97-error.html)

Dale[_10_]

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.

No Name

Excel 97 error
 
I found the problem.


All times are GMT +1. The time now is 11:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com