Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro,Multiple Workbook

Status
Not open for further replies.

Nitha120

Technical User
Feb 22, 2005
33
US
Hi guys,
I am trying to import multiple workbook to one workbook and save it. How do I do that?
I wrote the codes it work until it get to this line.

newSheet.Name = Left$(tempname, Len(tempname))

the error said that either my files is more then 31 character long or I am using the /,\,[], in naming the files.

My files name is longer then 31 but are there anyway to set unlimited character?

any suggestion is welcome!
 
Brute force method (Excel2k or above):
newSheet.Name = Left$(Replace(Replace(Replace(Replace(tempname, "/", "_"), "\", "_"), "[", "_"), "]", "_"), 31)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top