Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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" wrote in message
...
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
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
HARD DRIVE DENISE New Users to Excel 7 March 11th 09 08:06 PM
Links to mapped drive change to refer to local hard drive SueD Links and Linking in Excel 1 May 8th 08 11:42 AM
Can I save to hard drive AND my flash drive at the same time? Gizelle Excel Discussion (Misc queries) 3 July 24th 06 08:27 PM
Drive - Folders - Files DPC Excel Discussion (Misc queries) 1 May 26th 05 08:39 PM
Erase Hard Drive Mark C[_4_] Excel Programming 2 February 27th 04 09:24 AM


All times are GMT +1. The time now is 06:08 PM.

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"