Folder Creation With A Macro

Nov 12, 2008

is it possible to write a macro that will create a folder labled "2009" then a subfolder for each month with four subfolders labled "Week 1" through "Week 4", and have the "March", "June", "September", and "December" folders contain subfolders labled "Week 1" through "Week 5"?

View 2 Replies


ADVERTISEMENT

How To Add Formatting To Shape Creation Macro

Aug 7, 2013

I have to create an identical button on 20 sheets.

I have a shape creation macro but it creates in the default format.

Can I either change the default format so they are created in the way I want or code to add formatting? I need no shadow, can colour (pref with gradient fill), bevelled edges and text.

Sounds like the first option will be easiest if it works!

View 1 Replies View Related

Macro To Locate Folder In A Folder And Save

Apr 13, 2009

looking for some code to save to a destination

destination address is
C:Documents and SettingsstDesktopOJF

now the problem is OJF has folders named 1 to 500

so if cell d5 = 487 it will need to look in the above desination and then open the folder and save it there.

View 10 Replies View Related

Excel 2003 :: Macro To Open Folder Then User Selects File Then Macro Continues To Run

Nov 6, 2011

I use Excel 2003 at work. I'm looking for some code that will Open a folder and then lets the user to select a file then continues to run the macro.

The file name they select will look similar to this K2271011.504 or K3011111.201

View 3 Replies View Related

Macro To Run If Only Folder Found

Feb 3, 2014

I would like to know how is it possible to only run a macro with IF command if a path is found in a computer. My desktop user is example, jc855, and my coworker is jc886.

I would like to start the IF command such as, if C:Usersjc855 & C:Usersjc886 found, then keep going, otherwise, message box : "You are not authorize to run this macro".

By having this path, people will be able to download this macro but the access is only granted if their user is added thru the VBA. (which only me can access to edit it).

View 5 Replies View Related

Run This Macro In Every Workbook In A Folder

Aug 4, 2009

I'm trying to figure out how to run the following macro on every workbook in a folder.

Sub SumsSheets()
Dim ws As Worksheet, LR As Long, i As Integer
For Each ws In ThisWorkbook.Worksheets

View 9 Replies View Related

Add-in Menu Creation

Jul 19, 2007

I am wanting to make a macro into an add-in. An add-in is basically a workbook with macros that is opened when excel is correct? I know how to create an additional menu item under an existing one, but I'm wanting to create my own menu with this add-in item under it. I've used this code to try and create the new menu and placed it in the workbook open:

HelpIndex = CommandBars(1).Controls("Help").Index
Set NewMenu = CommandBars(1).Controls.Add(Type:=msoControlPopup, Before:=HelpIndex, Temporary:=True)
NewMenu.Caption = "&Separate Cashiers"

But ran into an error on the first line of code. I saved the workbook with the add-in macro in it as an .xla and used the addins under tools to have it open each time.

View 8 Replies View Related

Lookup Folder From Cell Text Then Save Excel File In This Folder

May 14, 2014

I have alot of project folders on my harddrive.

All in format: I:/12345-costumer-projectname/

The five digits are unique for each project.

I make calculations for these projects using an excel file. In this excel I also type the projectnumber (cell J2)

Now i would like to make a button. When pressed, it checks the projectnumber cell J2, looksup the corresponding folder and saves the excelfile in PDF format in this folder.

I have found macro to find files in folders, but none which do the above.

View 4 Replies View Related

Macro To Save As To Specific Folder

Apr 29, 2014

Looking for VBA code to automatically save an excel file as an .xlsx format, and saving to a specific folder: C:UserswolfmDesktopLoad Lists

I have been using the attached code, but it's not working. It saves to the desktop, not the folder. Also, when it creates the file name based on sFile = ActiveSheet.Range("C4").Value & ".xlsx", it adds wierd things to the file name. I want the file name to be simply the value in C4.

View 2 Replies View Related

Display Folder Name In Excel - VBA Macro

May 19, 2014

I need a macro which displays the folder and subfolder name from a specific path in the column A of the excel sheet in the same heirarchy. Also whenever a sub folder name is displayed in column A, I need its main folder name to be displayed in the same row Column B i.e offset(0,1). I have a macro, but it displays the folder name in the 1st cell of column B, I need it to increment to the subsequent cells based on subfolders.

Sub Step1()
Dim startRange As Range
Sheet1.Cells.Clear
Set startRange = Sheet1.Range("A5")
'Parent Directory - Change this to whichever directory you want to use
ListFoldersAndInfo "C:desktop", startRange
End Sub

[code]......

View 3 Replies View Related

Using Macro - How To Rename Filenames In Folder

Sep 22, 2010

I need tht How to rename the Filenames in an Folder using macro.. Is it possible, How we can do it..

Example: In an Folder 200files are there with extension .jpg/xls/bmp/txt/doc files, I want to rename tht those files names,

Example1:
Source File: TestImage.jpg
I want rename as
Destination file : image.jpg.

Not only Single file rename..if I want to rename Bulk means?...

View 14 Replies View Related

Macro To Create Folder In Computer

Mar 6, 2014

Can a macro create a folder in my computer and use the value in cell A1 as the folder name? This is where I want the folder to be created C:UsersUserDesktop.

View 8 Replies View Related

Find A Folder Extension Macro

May 23, 2008

this query has now took a peculiar twist in the fact that my boss now wants to change the goalposts

here is a thread with the code in

[url]

View 14 Replies View Related

Getting Macro To Save In Folder Specified On Worksheet

Oct 8, 2008

I have a macro that currently saves and prints the sheet I'm working on. At the moment, it saves everything in the same place and always calls the file the same name.

In the worksheet, a lookup does actually specify what folder it should be saved in and what name it should be given. How can I write the code so that it pulls up the name and the folder directly from the sheet it's saving?

View 3 Replies View Related

Execute A Macro In All Files In A Folder

Apr 22, 2009

I found the following code to execute a macro in all excel files in a folder. Sounds amazing! I have a code to add to it, however I am having issues getting it to work. take a look at it and let me know what (more like, how many things). I am adding this to the Sheet 1 Worksheet.

View 3 Replies View Related

Macro Saving To Wrong Folder?

Jan 10, 2012

I have a macro that saves the workbook after it has finsihed the rest of its formatting. I am finding it is saving in the wrong folder. I looked at my code and it is clearly states 'my documents' where I want it to save. Yet it keeps saving on a random folder on a shared drive.

View 8 Replies View Related

Macro That List Files In A Folder

Jul 10, 2012

Here is a macro I have found and manipulated for my particular case. The problem is that I want to narrow the search criteria by just pdfs and only those starting with Segment which i know in coding would be something like "Segment" & "*" & ".pfd" or something to those terms but the code uses objects which I'm not too familiar with.

Code:
Sub ListAllFile()

Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim ws As Worksheet

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set ws = Sheets("Simple Cut Lists (2)")

[Code] ........

How do i set objFile to just pick up my criteria?

View 3 Replies View Related

Macro To Copy Folder From One Location To Another

Jul 12, 2012

I'm trying to write a set of macros and one of the macros needs to move a folder with subfolders from P:CJ to P:WO

Now I've been using the CopyFile State. Is there something similar because in my search they talk about using FileSystemObjects and I have now clue how to use those.

View 1 Replies View Related

Open All Files In Folder And Run Macro

Jul 19, 2012

Please look at the code below...need this to open and run FIXId macro, save and close then loop through all files in the specified folder.

Code:
Sub CorrectID()
Dim Wb As Workbook, sFile As String, sPath As String
Dim itm As Variant
Dim strFileNames As String

sPath = "C:UsersXXXDocumentsFlash Repots2012"
sFile = Dir("C:UsersXXXDocumentsFlash Repots2012" & "*.xlsx")

[Code] ....

View 7 Replies View Related

Macro To Delete Items In A Folder

Aug 14, 2013

I have macro to copy data from one folder to another. However I would like a macro to delete the files in the source folder once copied

View 6 Replies View Related

Macro To Print All XLS Files In A Folder

Nov 25, 2013

Excel macro that "simply" prints out all files in a folder on my local C drive?

E.g. C:example

This folder could contain anything from zero to 50 files.

I'm not sure where to start with the VBA code.

View 2 Replies View Related

Macro To Rename Files In A Folder

Jun 16, 2014

Macro to rename files

I have following problem, discribed also in the link above.

I need a vba code to

- choose a folder instead of a file
- find all the files in the chosen folder with name that starts with "sz" and end with "_d"
- rename those files by replacing the first 5 numbers that follow sz with 5 different numbers that the user can choose e.g. through a user form.

I imagine the user to open the excel file, click on a form thats linked to a macro. The macro will call a userform and ask the user to choose the folder and type in a textbox the 5 new numbers.

I need the code that will be pasted behind the "OK" button in the userform.

Is this possible with vba?

Here a code i found in the link mentioned above, that i have applied and works - but needs to be modified to meet my needs:
Sub GetImportFileName()

Dim Filt As String
Dim FilterIndex As Integer
Dim Title As String
Dim FileName As Variant
Dim newname As String

[Code].....

View 2 Replies View Related

Using Search File In A Folder By Macro

Feb 13, 2008

I would like to write a mocro which open the search files in a folder window. The window will get parametrs through the macro and should show the results.
I tried to record it from file menu, but it didn't work.

View 9 Replies View Related

Macro Run As A Loop On All Files In A Given Folder

Mar 22, 2008

macro to run as a loop on all files in a given folder but allow for the option to Browse for the folder I want this to run in?

Sub CleanUp()
Dim i#, rng As Range
With Application
.ScreenUpdating = False
.DisplayAlerts = False
For i = Worksheets.Count To 1 Step -1
If Worksheets.Count = 1 Then GoTo e
Set rng = Intersect(Worksheets(i).[11:11,13:13,23:23,25:25], _
Worksheets(i).UsedRange)
With rng
.Replace What:=Chr(32), Replacement:="", LookAt:=xlPart
.Replace What:=Chr(160), Replacement:="", LookAt:=xlPart
End With...........................

View 10 Replies View Related

Macro Needed To Open Folder

Oct 4, 2008

need a macro that will open the following folder

c: my documentskatyexcel

View 9 Replies View Related

Loop Through Folder, Run Macro On All Files

Mar 5, 2009

I am trying to process 60+ data files. I've recorded/written macros that do all of the processing, and now I would like to write a loop that will go through a folder with the data files (.txt, tab delimitted), and run the code on each file. I am using the Mac Version of Excel 2004. I have tried to adapt some code that I found in the forums, but after fixing a few errors, now nothing is happening when I run the code. The code is below. I have it in a module in the VBA editor.

length of the code; I'm assuming the problem is in the very beginning or end (the code I added for the loop), as the code in the middle that does the actual processing works.

Sub ProcessData()

Dim strDocPath As String
Dim strCurrentFile As String

strDocPath = "Macintosh HD"":Users:thomasarmstrong:Desktop:SF08_Macrosv2:Loop_test:directory:"
strCurrentFile = Dir(strDocPath & MacID("TEXT"))

View 9 Replies View Related

Macro To Save In Server Folder

Sep 17, 2009

Our small company only has 5 computers in it with mine acting as the "server". I want to put a macro on our customer order forms that all computers can access on the server that will save the file as 3 or 4 cell names serparated by commas and save it in a specific location on the server.

I got the macro to work perfectly on my computer but when I try to type in the appropriate path to the server the file gets saved in their My Documents folder 99% of the time. I did get it to work twice but it seembed to be completely random as it didn't work any of the times before or after.

Here's what I have so far: ...

View 9 Replies View Related

Excel 2003 :: Extract Variable Rows Of Cells From Files In A Folder To Existing File In Folder

Mar 15, 2013

I need a macro in a workbook to look at all the files in the same folder that have "*att*.xls" in the name and determine and copy from the range A15:W515 only the rows that have data in at least columns A, C and D. Each file will vary as to how many rows there will be and there are more than the files with "*att*.xls" in the folder. The data will be on the only worksheet in each file and the worksheet is named "G2WAttendee_xls" the data from all the files need to be copied to the file called "Consolidated webinar reports.xls" (I am using Excel 2003) and to a sheet called "Attendance Data" and added to the end of the last paste.

At the start of the macro the current file "Consolidated webinar report.xls" should be saved to a sub folder of the current directory and have the date saved added to the name. The sub folder is called "Completed reports". The data in the original file on worksheet "Attendance Data" should be deleted.

At the end of the process all the files that have had data copied from them should be moved to the sub folder "Attendance reports consolidated" (This could be done as each file is closed if that is easier).

I have headings in row 1 of the "Attendance Data" worksheet that match the headings in the various files in the folder (which will always be in row 14 of the individual "*att*.xls" files).

The folder with all the files and the "Consolidated webinar report.xls" file is at path "Z:P and S MEvaluationsWebinar series 2012-13TB".

View 9 Replies View Related

For All Workbooks In Folder - Copy Range To Different Workbook - Save To New Folder?

Apr 21, 2014

I have up to 50 workbooks in one folder with data in a specific range. I also have one workbook which includes additional data, including conditional formatting and dropdowns. I need to copy the desired range from the first workbook in the source folder to the second workbook, then save the latter to my destination folder, using the same name as the first. I need to repeat this process for all workbooks in the source folder.

View 2 Replies View Related

VBA Code To Find A Folder Name Within Parent Folder That Contains Defined Text

Jul 23, 2014

I have an Excel VBA Macro for creating/logging drawing numbers. Each drawing belongs to a job number. Each job number has a folder name containing the job number followed by a description (ie 999999 - bracket assembly) for storing drawing pdf's. The job number is only known as a 6 figure number in the drawing creation process BUT for the PDF saving process it is a string value...as my example above

I have to change my process by pre-creating the Job Number folder, then have the macro look for the appropriate folder by searching the parent folder for a sub folder containing the job number (always the first 6 figures).

I want to insert in my macro some code that searches...

The parent folder for a folder containing the job number. The macro value for the parent folder is P:engineeringdrawings (this never changes). the macro value for the job number is iOpenair (it's an entry that is entered as start the macro). Imagine the value for the job number is "999999"...so the search would be for "999999*.*" The code needs to search the parent folder, find the folder name that begins with a six digit number. Capture the complete name of the folder and store that name as a Dim value that I can call up elsewhere in my macro.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved