D
Dale
I wrote this program on excel 2002 and it work perfectly.
The problem is that my associates that are running it are
using excel 1997 and they are getting a "Compile Error,
sub or function not defined message". if anyone could
help me out, I dont have access to excel 97 to try some
things out. here is the code:
Sub LoadFactor()
' LoadFactorEquation Macro
' Macro recorded 6/16/2004 by Dale D. Marques
' Declaring and Setting Variables
Dim kWh As Range
Dim Demand As Range
Dim Days As Range
Dim Factor As Range
Set kWh = Worksheets("Customer").Range("G7:G23000")
Set Demand = Worksheets("Customer").Range("H7:H23000")
Set Days = Worksheets("Customer").Range("K7:K23000")
Set Factor = Worksheets("Customer").Range("L7:L23000")
Factor.ClearContents
' For Loop for Calculation
For i = 1 To kWh.Cells.Count
If kWh.Cells(i) <= 0 Then
Factor.Cells(i) = "0.00"
End If
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("L7:L23000").NumberFormat
= "0.00"
Worksheets("Customer").Columns
("A:L").EntireColumn.AutoFit
End Sub
The problem is that my associates that are running it are
using excel 1997 and they are getting a "Compile Error,
sub or function not defined message". if anyone could
help me out, I dont have access to excel 97 to try some
things out. here is the code:
Sub LoadFactor()
' LoadFactorEquation Macro
' Macro recorded 6/16/2004 by Dale D. Marques
' Declaring and Setting Variables
Dim kWh As Range
Dim Demand As Range
Dim Days As Range
Dim Factor As Range
Set kWh = Worksheets("Customer").Range("G7:G23000")
Set Demand = Worksheets("Customer").Range("H7:H23000")
Set Days = Worksheets("Customer").Range("K7:K23000")
Set Factor = Worksheets("Customer").Range("L7:L23000")
Factor.ClearContents
' For Loop for Calculation
For i = 1 To kWh.Cells.Count
If kWh.Cells(i) <= 0 Then
Factor.Cells(i) = "0.00"
End If
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("L7:L23000").NumberFormat
= "0.00"
Worksheets("Customer").Columns
("A:L").EntireColumn.AutoFit
End Sub