A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

selecting sheets in an array



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2004, 01:35 AM
external usenet poster
 
Posts: n/a
Default selecting sheets in an array

hi

i want to select a few sheets and move it before a sheet
name total.

i have to program as :
Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005")).Select
Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005")).Move
After:=Sheets(9)

i am successful is forming the string
Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005")) by the code
as:
str = ""
For n = 1 To m
If n = m Then comStr = "" Else comStr = ","
If n = 1 Then begStr = "Sheets(Array(" Else begStr = ""
If n = m Then endStr = "))" Else endStr = ""
str = begStr & str & """" & arrSh(n) & """" & comStr &
endStr
Next n
Debug.Print str


str final output would be as:
"Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005"))"
but i am unable to use this str... likfe i want to now do
as str.select. how to acheive that
i hope i am clear
  #2  
Old June 30th, 2004, 02:12 AM
Earl Kiosterud
external usenet poster
 
Posts: n/a
Default selecting sheets in an array

Perhaps you can use:

Sheets(Array(arrSh(1), arrSh(2), ... )).Move After:=Sheets(9)

Also, it isn't necessary to select the sheets to move them.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

wrote in message
...
hi

i want to select a few sheets and move it before a sheet
name total.

i have to program as :
Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005")).Select
Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005")).Move
After:=Sheets(9)

i am successful is forming the string
Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005")) by the code
as:
str = ""
For n = 1 To m
If n = m Then comStr = "" Else comStr = ","
If n = 1 Then begStr = "Sheets(Array(" Else begStr = ""
If n = m Then endStr = "))" Else endStr = ""
str = begStr & str & """" & arrSh(n) & """" & comStr &
endStr
Next n
Debug.Print str


str final output would be as:
"Sheets(Array("Q1 2005", "Q2 2005", "Q3 2005"))"
but i am unable to use this str... likfe i want to now do
as str.select. how to acheive that
i hope i am clear



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing ARRAY elements with RANGE data and created a 2nd array JimP Worksheet Functions 2 March 10th, 2004 07:29 PM
Array reference from current row to bottom of column JM Worksheet Functions 0 February 26th, 2004 01:09 PM
Question on Array Formula John Worksheet Functions 1 February 21st, 2004 05:40 PM


All times are GMT +1. The time now is 04:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.