Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Create Sub Directories From Excel Column via Macro

I have a column in an XLS table, looking like this:

SomeValue1
SomeValue2
SomeValue3

I would like to create a macro that goes through all entries in a
column and if there is a value there, creates a sub-directory in a
speicifed directory.

For example if I specify "C:\Temp" at the top of the Macro, then for
the above example, the following sub-directories will be created:

c:\temp\SomeValue1
c:\temp\SomeValue2
c:\temp\SomeValue3

How could I go about writing such a Macro.

Thanks,

Anil

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Create Sub Directories From Excel Column via Macro

And the reply to your earlier post did not work ?

NickHK

wrote in message
oups.com...
I have a column in an XLS table, looking like this:

SomeValue1
SomeValue2
SomeValue3

I would like to create a macro that goes through all entries in a
column and if there is a value there, creates a sub-directory in a
speicifed directory.

For example if I specify "C:\Temp" at the top of the Macro, then for
the above example, the following sub-directories will be created:

c:\temp\SomeValue1
c:\temp\SomeValue2
c:\temp\SomeValue3

How could I go about writing such a Macro.

Thanks,

Anil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Create Sub Directories From Excel Column via Macro

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Const BASE_DIR As String = "C:\Temp\" '<=== change to suit
Dim i As Long
Dim iLastRow As Long
With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To iLastRow
MkDir BASE_DIR & .Cells(i, TEST_COLUMN).Value
Next i

End With

End Sub

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
oups.com...
I have a column in an XLS table, looking like this:

SomeValue1
SomeValue2
SomeValue3

I would like to create a macro that goes through all entries in a
column and if there is a value there, creates a sub-directory in a
speicifed directory.

For example if I specify "C:\Temp" at the top of the Macro, then for
the above example, the following sub-directories will be created:

c:\temp\SomeValue1
c:\temp\SomeValue2
c:\temp\SomeValue3

How could I go about writing such a Macro.

Thanks,

Anil



Reply
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
Macro to save file in changing directories? [email protected] Excel Programming 2 April 18th 07 06:24 PM
Excel macro to create directories? TomK Excel Programming 3 November 2nd 06 04:02 PM
Create list from directories SoloGIS Excel Discussion (Misc queries) 1 November 22nd 05 09:01 AM
Create Windows Directories from column entries? || cypher || Excel Discussion (Misc queries) 2 July 22nd 05 04:11 PM
Create Windows Directories from column entries? || cypher || Excel Worksheet Functions 2 July 22nd 05 04:11 PM


All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"