LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default import sheets of name selected

Assume MyProject.xls is open

Dim v as Variant
Dim s as String
Dim s1 as String
Dim iloc as Long
s = "#RULES#CONDITIONS#ROUTING#ZONES#"
s1 = s
Redim v(0 to 0)
for each sh in Workbooks("Myproject.xls").Worksheets
iloc = instr(1,"#" & sh.Name & "#",s,vbTextCompare)
if iloc < 0 then
v(ubound(v)) = sh.Name
s = Replace(s,sh.Name & "#","")
redim Preserve v(0 to ubound(v) + 1)
end if
Next
if len(s) < s1 then
Redim preserve v(0 to ubound(v)-1)
workbooks("Myproject.xls").Worksheets(v).copy
End if
if len(s) 1 then
s = Right(s,len(s)-1)
s = Replace(s,"#",vbCr)
msgbox "Sheets not found: " & vbCr & s
End If

--
Regards,
Tom Ogilvy

"ilyaskazi" wrote
in message ...

import sheets


i need to import sheets of following names from "MYProject.xls" in my
new workbook.

RULES, CONDITIONS, ROUTING, ZONES.


Only check above sheet names in MyProject.xls and import in new wrkbk.
If not found any then display its name in msgbox.


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile:

http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=376676



 
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
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
Excel should be able to import selected data from MS Word family1935 Excel Discussion (Misc queries) 0 February 13th 06 08:36 PM
Can you save options selected in Text Import Wizard? Gary Brown[_5_] Excel Programming 2 April 19th 05 02:09 PM
Import selected data J Excel Programming 1 February 14th 05 05:53 PM
Import selected lines from an Ascii file drbobsled Excel Programming 1 June 23rd 04 12:19 AM


All times are GMT +1. The time now is 05:08 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"