Thread: Array error
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pwz pwz is offline
external usenet poster
 
Posts: 5
Default Array error

Hello All,

I have encountered the following error message:

Run-time error '9'
Subscript out of range

sName1 = sh.Name & " Hi"
sName2 = sh.Name & " Hello"
Sheets(Array(sName1, sName2)).Copy

The copy statement works if I replace the variables with actual sheet name.
May anyone give some hints to me? Thanks in advance!


Regards,

PW