K
Katie Kendrik
hi,
below is my code. I am geting error at line {Set layer_array2 =
Worksheets("UserDefinedItems").Range("Layers_array")- this is the third line
on my code.
I have an array of cells on the excel sheet named "Layers_array". When I run
the sub it runs fine and gives me desired results. But when I close the
workbook. I get an error on this line.
Can somebody please help me.
Private Sub Pick_Layer1_wall2_change()
countercol = 2
Set layer_array2 = Worksheets("UserDefinedItems").Range("Layers_array")
mycell = ActiveSheet.Cells(8 + counterrow, 3).Value
If mycell = "UserDefined" Then
Cells(8, 3 + countercol).Interior.ColorIndex = 2 '2 is white.
Cells(8, 3 + countercol).Value = "Enter Value"
Cells(8, 4).Value = "Enter Value"
Else
For i = 2 To 5
Cells(8, 3 + countercol).Interior.ColorIndex = 15
ESW2look = WorksheetFunction.VLookup(mycell, layer_array2, i, False)
' MsgBox ESW2look
Cells(8, 3 + countercol).Value = ESW2look
ESW2lookvalue = IsError(ESW2look)
If ESW2lookvalue = True Then
MsgBox "Check the Exterior Skin type chosen"
End If
countercol = countercol + 1
Next i
End If
'Layer_ValuesPick myrow1
End Sub
below is my code. I am geting error at line {Set layer_array2 =
Worksheets("UserDefinedItems").Range("Layers_array")- this is the third line
on my code.
I have an array of cells on the excel sheet named "Layers_array". When I run
the sub it runs fine and gives me desired results. But when I close the
workbook. I get an error on this line.
Can somebody please help me.
Private Sub Pick_Layer1_wall2_change()
countercol = 2
Set layer_array2 = Worksheets("UserDefinedItems").Range("Layers_array")
mycell = ActiveSheet.Cells(8 + counterrow, 3).Value
If mycell = "UserDefined" Then
Cells(8, 3 + countercol).Interior.ColorIndex = 2 '2 is white.
Cells(8, 3 + countercol).Value = "Enter Value"
Cells(8, 4).Value = "Enter Value"
Else
For i = 2 To 5
Cells(8, 3 + countercol).Interior.ColorIndex = 15
ESW2look = WorksheetFunction.VLookup(mycell, layer_array2, i, False)
' MsgBox ESW2look
Cells(8, 3 + countercol).Value = ESW2look
ESW2lookvalue = IsError(ESW2look)
If ESW2lookvalue = True Then
MsgBox "Check the Exterior Skin type chosen"
End If
countercol = countercol + 1
Next i
End If
'Layer_ValuesPick myrow1
End Sub