Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Create folder with a macro

Hi...

I'm on a VB mission to create a folder based on cells in
"Column A". A folder will be created when user executes
OK commandbutton which will filter data on excel worksheet.


I was successful in creating a folder with defining one range ("A1").
However, I get stuck when specifying multiple ranges. I tried "A:A",
"A1:A65353".
Any suggestions how I got stuck with a bug??

This is the code I'm using in the OK Command Button.

Dim x As String
x = "S:\Employee Folders\" & Range("A1:A65535")
On Error Resume Next
MkDir x

I'm getting this error: Type Mismatch

Thanks for your helping hand!
Myrna


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Create folder with a macro


Dim x As String
Dim cell As Range

On Error Resume Next

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For Each cell in Range("A1:A" & cLastRow)
x = "S:\Employee Folders\" & cell.Value
MkDir x
NExt cell

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Myrna Rodriguez" wrote in message
...
Hi...

I'm on a VB mission to create a folder based on cells in
"Column A". A folder will be created when user executes
OK commandbutton which will filter data on excel worksheet.


I was successful in creating a folder with defining one range ("A1").
However, I get stuck when specifying multiple ranges. I tried "A:A",
"A1:A65353".
Any suggestions how I got stuck with a bug??

This is the code I'm using in the OK Command Button.

Dim x As String
x = "S:\Employee Folders\" & Range("A1:A65535")
On Error Resume Next
MkDir x

I'm getting this error: Type Mismatch

Thanks for your helping hand!
Myrna


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Create folder with a macro


Hi Bob~

Thanks so much! You're a magician...
The code works successfully.
Curious? what does HTH stands for in your signature?
thanks!
Myrna


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Create folder with a macro

Hope This Helps<g

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Myrna Rodriguez" wrote in message
...

Hi Bob~

Thanks so much! You're a magician...
The code works successfully.
Curious? what does HTH stands for in your signature?
thanks!
Myrna


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



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 create a folder and copy files GainesvilleWes New Users to Excel 2 February 26th 07 06:33 PM
Macro to create a new folder according to the month Dolphin Excel Discussion (Misc queries) 5 December 15th 06 01:31 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
Macro to create folder yo beee Excel Programming 1 October 21st 03 02:10 AM


All times are GMT +1. The time now is 06:40 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"