Thread: arrays
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default arrays

Tajin,

If you can get the worksheet names, to write them to your template is as
simple as coding within your template

strSheetName = ...... use the same method which you are using to get the
name for the msgbox

Thisworkbook.Worksheets("Sheet1").Range("A7").Valu e = strSheetName

As to moving the focus, there are as many methods as there are VBA coders,
and the best method depends on how you are actually doing your procedure.
For example, you could simply loop:

For myCol = 1 to 4
For myRow = 7 to 15
Cells(MyRow,MyCol).Value = "whatever ..."
Next myRow
Next myCol

But, as I've said, the best method depends on what you are doing overall in
your procedure.

HTH,
Bernie
MS Excel MVP

"Tajin" wrote in message
...
I have a template that needs to be filled out from fields coming from

other
excel spreadsheet available in the server( actually sheet names), I want

to
make available only this values to make the choice on Worksheet_change on
that excel template, I can get all the worksheet names in msgbox one by

one
but I don't know how to pass them to one of the cells in my template,

should
do it on arrays?, how?, I want also to move the focus from the first cell
the one on the right side and following one to right side, like for

example
if A7 is the first cell, 2nd one B7, 3rd C7, 4th D7, next A8, B8, C8, D8,
etc..

Thanks