Thread: Array
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson[_2_] Dave Peterson[_2_] is offline
external usenet poster
 
Posts: 420
Default Array

Since you're only copying a single sheet, you don't need the Array() portion:

ThisWorkbook.Worksheets("Tab name").Copy

You could use something like this to get the value from a cell on a worksheet:

ThisWorkbook.Worksheets(thisworkbook.worksheets("S omeSheet").range("A1").Value)).copy

or to save a bit of typing:

With thisworkbook
.worksheets(.worksheets("somesheet").range("a1").v alue).copy
end with



On 06/08/2011 07:10, kevcar40 wrote:
Hi
I am using the formula below to copy a worksheet, which is then pasted out to another workbook.

ThisWorkbook.Worksheets(Array("Tab name")).Copy

is it possible for me to use a cell value instead of having to enter the worksheet name

or

read the Worksheet tab and use this value

thanks

kevin


--
Dave Peterson