VBA- Error while closing the file

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
 
D

Doug Robbins - Word MVP

I would suggest that you post your question to the
microsoft.public.excel.programming newsgroup. This one is for the use of
VBA in Word.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top