Hello Friends!!
I am using following code to create a header row at "Cell_ref" Location.
Public Function Pressure_Drop(Cell_ref As String)
'Generates Header Row for Pressure Drop Calculations
'Dim Cell_ref As String
'Cell_ref = "A2"
Pressure_Drop = "Pressure Drop Calculation as per Crane Technical Paper"
Evaluate "Pressure_Drop_Header(" & Cell_ref & ")"
End Function
Public Sub Pressure_Drop_Header(Cell_ref As String)
Dim Cell1 As Range
Set Cell1 = Range(Cell_ref)
Cell1.Value = "Fitting Type"
Cell1.Offset(0, 1).Value = "Fluid"
Cell1.Offset(0, 2).Value = "Inlet Pressure, in Pa"
Cell1.Offset(0, 3).Value = "Pipe Material"
Cell1.Offset(0, 4).Value = "NPS Unit"
Cell1.Offset(0, 5).Value = "NPS"
Cell1.Offset(0, 6).Value = "Schedule"
Cell1.Offset(0, 7).Value = "Ft, Friction Factor for NPS Crane"
Cell1.Offset(0, 8).Value = "K, Pressure Drop Factor"
Cell1.Offset(0, 9).Value = "f, Friction Factor"
Cell1.Offset(0, 10).Value = "Head Loss hL, in m"
Cell1.Offset(0, 11).Value = "Pressure Drop, in Pa"
Cell1.Offset(0, 12).Value = "Outlet Pressure, in Pa"
Columns("A:Z").AutoFit
End Sub
On calling Function from worksheet like:
=Pressure_Drop("A2")
I get error in value. Can somebody help please.
Bookmarks