PC Review


Reply
Thread Tools Rate Thread

Create Sub Directories From Excel Column via Macro

 
 
the_golden_gunman@hotmail.com
Guest
Posts: n/a
 
      18th Jul 2007
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 With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      18th Jul 2007
And the reply to your earlier post did not work ?

NickHK

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      18th Jul 2007
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)

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a macro in excel so that it can generate a list ofunique records using all permutations and combinations of the data in eachrow ad column Rizwan Microsoft Excel Misc 1 6th Aug 2009 01:44 PM
Excel macro to create directories? TomK Microsoft Excel Programming 3 2nd Nov 2006 04:02 PM
Create Windows Directories from column entries? || cypher || Microsoft Excel Discussion 2 22nd Jul 2005 04:11 PM
Create Windows Directories from column entries? || cypher || Microsoft Excel Misc 2 22nd Jul 2005 04:11 PM
Create Windows Directories from column entries? || cypher || Microsoft Excel Worksheet Functions 2 22nd Jul 2005 04:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:28 PM.