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!!