+ Reply to Thread
Results 1 to 3 of 3

creating folders on hard drive from name field

  1. #1
    Italian Pete
    Guest

    creating folders on hard drive from name field

    Hi,
    I have an excel spreadsheet containing information about people. The
    first two columns are name and surname. In addition, for each person, there
    is a separate photo (not attached to the spreadsheet). I need to create a
    folder for each of the people on the spreadsheet such that I can put their
    photo into it. I would like each of the folders to be named name.surname
    taken from the spreadsheet. I'm a bit of a newbee to VBA in Excel. How would
    I go about doing this?

    many thanks,

    Pete

  2. #2
    Bob Phillips
    Guest

    Re: creating folders on hard drive from name field

    Something like

    Const kBaseFolder As String = ":C:\Staff\Photos\"

    For i = 1 To cells(Rows.Count,"A").End(xlUp).Row
    makdir kBaseFolder & Cells(i,"B").Value & "-" & Cells(i,"A").Value
    Next i

    I have added the forename as well, just in case there are tow with the same
    surname.

    --
    HTH

    Bob Phillips

    "Italian Pete" <ItalianPete@discussions.microsoft.com> wrote in message
    news:3796151B-9CA1-4F88-922F-E2500C375712@microsoft.com...
    > Hi,
    > I have an excel spreadsheet containing information about people. The
    > first two columns are name and surname. In addition, for each person,

    there
    > is a separate photo (not attached to the spreadsheet). I need to create a
    > folder for each of the people on the spreadsheet such that I can put their
    > photo into it. I would like each of the folders to be named name.surname
    > taken from the spreadsheet. I'm a bit of a newbee to VBA in Excel. How

    would
    > I go about doing this?
    >
    > many thanks,
    >
    > Pete




  3. #3
    Italian Pete
    Guest

    Re: creating folders on hard drive from name field


    Thanks Bob. Worked a treat.
    "Bob Phillips" wrote:

    > Something like
    >
    > Const kBaseFolder As String = ":C:\Staff\Photos\"
    >
    > For i = 1 To cells(Rows.Count,"A").End(xlUp).Row
    > makdir kBaseFolder & Cells(i,"B").Value & "-" & Cells(i,"A").Value
    > Next i
    >
    > I have added the forename as well, just in case there are tow with the same
    > surname.
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "Italian Pete" <ItalianPete@discussions.microsoft.com> wrote in message
    > news:3796151B-9CA1-4F88-922F-E2500C375712@microsoft.com...
    > > Hi,
    > > I have an excel spreadsheet containing information about people. The
    > > first two columns are name and surname. In addition, for each person,

    > there
    > > is a separate photo (not attached to the spreadsheet). I need to create a
    > > folder for each of the people on the spreadsheet such that I can put their
    > > photo into it. I would like each of the folders to be named name.surname
    > > taken from the spreadsheet. I'm a bit of a newbee to VBA in Excel. How

    > would
    > > I go about doing this?
    > >
    > > many thanks,
    > >
    > > Pete

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1