AleksArcher
New Member
- Joined
- Jun 9, 2007
- Messages
- 4
Hi all -
I am getting a Run-time error '1004' Method 'Range' of object '_Worksheet' failed on the following line:
This project is bit of stretch for me using named range values in worksheet code. The range "Domestic_FSR_Series7_Duration_d" is storing 42 as a value.
Any guidance is very much appreciated
Here is the whole code (thus far) for reference:
I am getting a Run-time error '1004' Method 'Range' of object '_Worksheet' failed on the following line:
Code:
hSheet.Cells(arow, 7) = cStart + Range(Domestic_FSR_Series7_Duration_d).Value
This project is bit of stretch for me using named range values in worksheet code. The range "Domestic_FSR_Series7_Duration_d" is storing 42 as a value.
Any guidance is very much appreciated
Here is the whole code (thus far) for reference:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim hSheet As Worksheet
Dim cSite As String
Dim cProgram As String
Dim cLocation As String
Dim cReq As Long
Dim cStart As Long
Set hSheet = Sheets("Hiring Schedule")
arow = Target.Row
aCol = Target.Column
If Not IsNumeric(hSheet.Cells(arow, 2)) And hSheet.Cells(arow, 2) <> "" _
And Not IsNumeric(hSheet.Cells(arow, 3)) And hSheet.Cells(arow, 3) <> "" _
And Not IsNumeric(hSheet.Cells(arow, 4)) And hSheet.Cells(arow, 4) <> "" _
And IsNumeric(hSheet.Cells(arow, 5)) And hSheet.Cells(arow, 5) <> "" _
And Not IsNumeric(hSheet.Cells(arow, 6)) And hSheet.Cells(arow, 6) <> "" Then
cSite = hSheet.Cells(arow, 2)
cProgram = hSheet.Cells(arow, 3)
cLocation = hSheet.Cells(arow, 4)
cReq = hSheet.Cells(arow, 5)
cStart = CDate(hSheet.Cells(arow, 6).Value)
hSheet.Cells(arow, 7) = cStart + Range(Domestic_FSR_Series7_Duration_d).Value
End If
End Sub