Setting aws to name stored in an array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following:

For iCtr = LBound(myWSNames) To UBound(myWSNames)
Set aWS = Nothing
Set aWS = Sheets(myWSNames(iCtr))
if aws is not nothing then
'do something
end if
Next iCtr

I have a list of worksheet code names in mywsnames. I'd like to set the
aws to be the name in the mywsnames list. It's not working. What do I need
to change?

Thanks
 
Had the syntax wrong: If Not aWS Is Nothing Then
'Do Something

Sorry bout that!
 

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

Back
Top