Thread: Sheets arrays
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tomas M. Tomas M. is offline
external usenet poster
 
Posts: 1
Default Sheets arrays

Hi,
I create some sheets and move them from source workbook to new one:
Sheets(Array(Range("Sheet1").Value, Range("Sheet2").Value)).Move

My problem is, that I need to get different arrays, as user select them in
some form. So, I found the code:
x = Array("Sheet1", "Sheet5", "Sheet7")
Sheets(x).FillAcrossSheets _
Worksheets("Sheet1").Range("A1:C5")
and I try it to use with '.move' method, but it fails with error '9',
Subscript out of range (but it fails too with the 'FillAcrossSheets' method,
as example above).

Is any solution to give arglist to function Array as a variable, or use
other function as argument list for sheets('sheets Array').move ? I tried it
with split of string, which contain all needed sheet names, and tried give
arglist as string ("name1","name2","name3"), but there is some errors too.

Thanks for help
Tomas M.

(I am sorry for my english ...)