View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kelly[_9_] Kelly[_9_] is offline
external usenet poster
 
Posts: 13
Default Is this macro scenario possible using VBA?

Hi there,

I'm new to VBA. I'd like to be able to have a column of cells in excel
that houses a directory path in each cell (for instance, A1 =
c:\folders\folder1, A2 = c:\folders\folder2, ... and so on). Each
destination directory contains a certain number of JPEG files. I need
to create a macro that looks in each folder and then spits out the names
of JPEGs in each folder.

For instance, if there are two JPEGs in c:\folders\folder1 (photo1.jpeg
and photo2.jpeg), could you write a macro for the following to occur:

A1 = c:\folders\folder1
B1 = photo1.jpeg
C1 = photo2.jpeg

For c:\folders\folder2, there are 4 photos (apple.jpeg, orange.jpeg,
banana.jpeg and grape.jpeg).

A2 = c:\folders\folder2
B2 = apple.jpeg
C2 = orange.jpeg
D2 = banana.jpeg
E2 = grape.jpeg

Also, given that the column of data I may be using for the directory
paths is not "A," I'd like to make it user defined so that I can use
"QQ" or "Z" or whatever I need to.

Many thanks for any energy devoted to my question.

Kelly


*** Sent via Developersdex http://www.developersdex.com ***