LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Francesco
 
Posts: n/a
Default Please I need some help to complete a VBA Macro

I am using excel 2003 and WindowsXp Professional
_______

I prepared a macro to creade a folder and a subfolder but I do not know How
to complete it
What I wrote is:

Sub Auto_Open()
Dim MyPath as String
Dim MyCell As String
Dim Name AS String

' puts the current in E1 ( ex. 10\04\2006)
Cells(1,5) = (Date)

' Inputs year 2006 of cell E1 in D5
WorkSheets("output").Range ("D5").Value = "=Year(E1)"

' MyCell takes the value of D5
MyCell = Sheets("output").Cells(5,4).Value

' Create a folder
On Error GoTo L1
MyPath = CurDir & "\"
MKDir MyPath & "InvoicingPrg"
L1:

'Note: Up to here the Macro works fine and creates the folder in C:\ named
"InvoicingPrg" and no errors occur even if the folder exists already.

What I need is to finf out if within the folder "C:\InvoicingPrg" exists a
foder named
"Invoice2006" ( Name = "invoice" & MyCell ), if yes exit the sub otherwise
creats the folder "Invoice2006".

I do not now how to do this second part provided, I hope, that the first
part of the Macro is correct.

Thankyou all
Francesco



 
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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


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

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"