Sabtu, 31 Maret 2012

[ExcelVBA] Re: Rename Files in Folders to Include Folder Names

 

I know I could do this with DOS commands, but I'm trying to figure out a way to do everything with an Excel workbook. Data and new spreadsheets are being created every day. Ideally, once done and the data from a workbook is collected in the collector tool, I want my code to delete the workbook.

--- In ExcelVBA@yahoogroups.com, Dr John C Bullas <john.bullas@...> wrote:
>
> I think DOS commands can grab folder names
>
> http://www.msfn.org/board/topic/56320-retrieve-current-directory-name-in-batch/
>
> Any good?
>
> Dr B
>
> On 30 March 2012 23:29, sspatriots <sspatriots@...> wrote:
> > Hi,
> >
> > I'm not certain on how this can be done, but I'm trying to come up with some code that will rename all the files in several subfolders. I need the new file names to include the folder name and part of the original file name.
> >
> > For example:
> >
> > I have folders named by tool numbers, a thread designation and a torque value, e.g. 0001-0832-5.5INLB. Inside these folders are some test results that are automatically generated by some software from a torque analyzer. Those file names are something like "QuickTest2 3-30-2012 9-59-40 AM.xls". Somehow, I need the folder information and the date information in each of the file names. I can lose the "QuickTest2" part.
> >
> > If I can get this far, then I'll need code to import the data from all these files along with their new file names so that I have a single workbook that gives me Tool Numbers, Thread Designations, Torque Values, Dates, etc...
> >
> >
> > Thanks,
> >
> > Steve
> >
> >
> >
> > ------------------------------------
> >
> > ----------------------------------
> > Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
> >
> > ----------------------------------
> > Visit our ExcelVBA group home page for more info and support files:
> > http://groups.yahoo.com/group/ExcelVBA
> >
> > ----------------------------------
> > More free tutorials and resources available at:
> > http://www.mousetrax.com
> >
> > ----------------------------------Yahoo! Groups Links
> >
> >
> >
>
>
>
> --
> ===========================
> http://uk.linkedin.com/in/drjohnbullas
>

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar