View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Adding data to a cell via VBA

If these named ranges are on another sheet, then you need to qualify them
with the sheet name where they are located. Assumet they are on a sheet
named Data, this would work:

With Worksheets("Data")
BackFillConstant = .Range("K").Value
FlowStress = .Range("FlowStress").Value
Charpy = .Range("CV").Value
FractureArea = .Range("A").Value
Pressure = .Range("P").Value
ArrestPressure = .Range("ArrestPressure").Value
End With

--
Regards,
Tom Ogilvy


"Aaron1978" wrote
in message ...

Here is my first attempt but I keep getting a runrime error '1004'. Any
ideas?


Option Explicit

Dim BackFillConstant As Single
Dim FlowStress As Single
Dim Charpy As Single
Dim FractureArea As Single
Dim Pressure As Single
Dim ArrestPressure As Single


Private Sub Worksheet_Change(ByVal Target As Range)

BackFillConstant = Range("K").Value
FlowStress = Range("FlowStress").Value
Charpy = Range("CV").Value
FractureArea = Range("A").Value
Pressure = Range("P").Value
ArrestPressure = Range("ArrestPressure").Value


If Target.Address = "$A$1" Then
If IsNumeric(Target) Then
'Range("B1") = Target.Value + 2
Range("B1") = fnFractureVelocity(BackFillConstant,
FlowStress, Charpy, FractureArea, Pressure, ArrestPressure)
End If
End If
End Sub


--
Aaron1978
------------------------------------------------------------------------
Aaron1978's Profile:

http://www.excelforum.com/member.php...o&userid=31201
View this thread: http://www.excelforum.com/showthread...hreadid=546244