Generating Folder from directory address in cell.

ToadOnRoll2

New Member
Joined
Aug 20, 2007
Messages
1
Hi,

I'm trying to generate a folder on the LAN in an address which is contained within a cell.

The code I've got is

Sub makefolder()

If Len(Dir(ADDRESS_CELL_REFERENCE, vbDirectory)) = 0 Then
MkDir ADDRESS_CELL_REFERENCE

End If

End Sub


But ADDRESS_CELL_REFERENCE needs to be a piece of code that points to the cell that contains the addess.

Thanks in advance for any help you may be able to offer.

:biggrin:
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Derek Brown

Well-known Member
Joined
Dec 26, 2005
Messages
2,390
Example:
Code:
Sub makefolder()
Dim strAddr As String
strAddr = ActiveSheet.Range("A1").Value
If Len(Dir(strAddr, vbDirectory)) = 0 Then
    MkDir strAddr
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,191,120
Messages
5,984,762
Members
439,909
Latest member
daigoku

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top