LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to select all sheets in front of a particular sheet???

You have been shown how to get the list of sheet names.
The macro will show the syntax to move to a new WB.

Combine the 2...

NickHK

"Jac" wrote in message
...
hi,

What do u mean by that???

The macro recorder will record down all the sheets' names in the coding
part!!!
That's what I don't want; & trying to look for other way out.........



"Don Guillett" wrote:

The macro recorder is your friend.

--
Don Guillett
SalesAid Software

"Jac" wrote in message
...
Hi Don,

Thanks for the solution!!

But what I want is not a fixed file which mean whenever all the sheets
that
were to be moved are created; then the macro would select all of them

&
open
a new file then place those selected sheets in the new file!!! So, the

new
file can be any file which would be created when need!!!

In MS Excel, it can be done by selecting (new book) in Move or

Copy....
option!
But how to do it in coding???



"Don Guillett" wrote:

Try this. Assumes book1 already in existance and open

Sub indexsheets()
For Each ws In Sheets
If UCase(ws.Name) = "RAW DATA" Then Exit For
ma = ma & "," & ws.Name
mx = Right(ma, Len(ma) - 1)
Next
Sheets(Split(mx, ",")).Select
Selection.Move Befo=Workbooks("Book1").Sheets(1)
End Sub

--
Don Guillett
SalesAid Software

"Jac" wrote in message
...
Hi,

I have files which the sheets are structured in such a way as

below:-
2009 2006 2005 2004 2003 2002 1990 Raw Data

Is there any way that I can use macro to select all the sheets

placed
in
front of Raw Data sheet and move it to a new file???
I have tried to record a macro to do so but all the sheet's names

are
being
specified in the code which made the macro not flexible; cause the
sheets
may
have been named with different years!!

Anyone has any solution; please advice....
Thanking in advance!!








 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying data from several sheets to a front sheet Marie Green Excel Worksheet Functions 1 April 9th 09 11:51 AM
Using VBA select sll sheets based on Criteria on each sheet. AirgasRob Excel Discussion (Misc queries) 4 September 3rd 08 03:11 PM
Print sheet 1 on front sheet 2 on back of a page J.W. Aldridge Excel Programming 1 November 16th 06 10:23 PM
In nameing a sheet in Excel it puts a .xls] in front why? EZE Excel Discussion (Misc queries) 2 April 27th 05 04:27 AM
how do I tell excell 2003 to print sheets back to front? goochiepepper Excel Discussion (Misc queries) 1 December 22nd 04 03:35 PM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"