LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default looping on excel files in directory

Hi All

If you can help my kindest thanks and sorry if I do not explain my issue
very well - I am no longer a programmer being old and grey ( whats left )

I have a direcory on my machine c:\finance
i want to loop in the directory on every .xls file ( open each SS and copy
data )
I am stuck on the loop I need to create and do not understand the DIR
structure very well - I suspect the code I want is simple in nature and is
more me being a poor VBA user.

If you can help please feel free -

Sub ProcessAll()

' ok we need to grab some meta data for Path and Extension from the META
cells

sPath = Worksheets("Meta").Cells(4, 2).Value
sExtension = Worksheets("Meta").Cells(6, 2).Value

If sPath = "" Or sExtension = "" Then
MsgBox "META data incorrect I will stop NOW check path and extension"
Exit Sub
End If

sFile = sPath & sExtension

MsgBox sFile

' so now we have the directory to loop within for all xls files ?


So far I have craeted this poor code




--
C Ward
 
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
Help to copy files names in a column from one directory to another directory VBA Paul B[_3_] Excel Programming 4 November 10th 08 01:54 AM
Getting Range whilst looping through files in directory George Excel Programming 1 March 30th 06 04:15 PM
Check if directory empty OR no of files in directory. Michael Beckinsale Excel Programming 2 December 4th 03 10:12 PM
Looping through each directory Keith Willshaw Excel Programming 0 July 11th 03 10:21 AM
Looping through each directory Tom Ogilvy Excel Programming 1 July 11th 03 09:39 AM


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