LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Create Folder Variable

I would like to create a variable that I can use to replace portion of my
create folder path. I am using this code to create folders. I would like to
replace the state "Colorado" as a variable based on a column of data in my
speard sheet. I just haven't been able to figure this out. Any when would be
appriciated.

Can the folder path be a variable as well based on a column of data?


Sub StartHere()

Dim rCell As Range, rRng As Range

With Sheet1
Set rRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each rCell In rRng.Cells

If rCell.Offset(0, 4).Value = "Colorado" Then

CreateFolders rCell.Value, "C:\InvestorFiles\United States\Colorado"

End If
Next rCell

End Sub
 
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
Open files with a variable name in a folder get name in B1 and sav Les Excel Programming 21 May 30th 08 05:06 PM
Changing the folder to a value stored in a variable instead of a s Pete Rooney Excel Programming 2 April 9th 08 04:14 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Create Folder and Text File in folder Todd Huttentsine Excel Programming 2 April 29th 04 03:41 PM
Create Folder / Copy Folder / Replace Murray Outtrim[_2_] Excel Programming 0 February 24th 04 06:40 PM


All times are GMT +1. The time now is 08:00 AM.

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

About Us

"It's about Microsoft Excel"