Hi,
I have a sheet that needs to utilize the following code:
Then I have another sheet that is utilizing a code to transport values which is:
So, I can't transport values to the sheet that has the first code I wrote. I only get an error stating the following:
Run time error 9
Subscript out of range
The code that transfer values work perfectly on other sheets that does not utilize the calculation code.
Anyone know the solution to the problem?
I have a sheet that needs to utilize the following code:
Code:
Private Sub worksheet_calculate()
Application.EnableEvents = False
Dim Xrg As Range
Set Xrg = Range("C6:C7")
If Not Intersect(Xrg, Range("C6:C7")) Is Nothing Then
Goalseek
Application.EnableEvents = True
End If
End Sub
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("$C$2:$C$7")) Is Nothing Then Exit Sub
Select Case Target.Address
' Address gets the cell name for the cell E.g. $B$4
Case "$D$2"
Worksheets("Calculations").Range("C7").Value = Worksheets("Values").Range("D2").Value
End Select
End Sub
Run time error 9
Subscript out of range
The code that transfer values work perfectly on other sheets that does not utilize the calculation code.
Anyone know the solution to the problem?