Hello,

I need to create sheets, and after creating I need a few things to do with them, and I also want to name them.
I have added a variable, nSheet, and I want to use it for the last sheet I created, somehow like this:

dim nSheet as worksheet
for i=lbound(myArray) to ubound(myArray)
    set nsheet=sheets.add after:=sheets(sheets.count) name=myArray(i)
    with nsheet
     .
     .
     end with
next
Unfortunately I cannot figure out, how this line
set nsheet=sheets.add after:=sheets(sheets.count) name=myArray(i)
should look like, maybe it cannot be done in one line.
Could anybody help?

Many Thanks