Create Workbooks & Save-Name By Sheet Tab Names

Oct 10, 2006

Every month I work on an audit that has data from 35 different distributors. I have code below that puts each distributors audit/sales information on a new tab and each new tab is given the distributors name. This also creates a new workbook for each distributor.

When the new workbooks are created, how can I name each workbook with the distributor name it's being created for? Is it possible to predefine a file path to where these new workbooks will be saved?

The distributor names I'm using are in column AF.


Sub FormatList()
'The code below creates and names a new tab for each members info
Dim ws1 As Worksheet
Dim wsNew As Worksheet
Dim rng As Range
Dim r As Integer
Dim c As Range
Set ws1 = Sheets("Sheet1")
Set rng = Range("Database")


'extracts a list of member or distributor names
ws1.Columns("R:R"). AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=Range("T1"), Unique:=True
r = Cells(Rows.Count, "T").End(xlUp).Row

'set up Criteria Area
Range("U1").Value = Range("R1").Value

For Each c In Range("T2:T" & r)
'adds the member name to the criteria area above
ws1.Range("U2").Value = c.Value
...............

View 9 Replies


ADVERTISEMENT

Can Create Data Validation List Of Names Created In Name Box Or Sheet Tab Names

May 7, 2012

Can I create data validation list of the names created in the name box or of the sheet tab names?

View 5 Replies View Related

Create Multiple Workbooks With Names Based On List

Sep 2, 2007

I have some very tedious work to do in Excel:

table looks like following:
DepID name function
S1 a YY
S1 b XX
S1 c ww
S2 d oo
S3 e ii
S3 f ll
S4 t mm
. . . . . .. . . .
. . . . . .. . . .
. . . . . .. . . .

S7999 u ee
S7999 w aa

My task is to create new folders for each department according to DepID, which means if there are 7999 departments, I have to create 7999 folders, any VBA code can do this?

View 9 Replies View Related

Create Array Of File Names/sheet Names

May 1, 2008

Two part question:

1) I'm relatively new to arrays, but what I need to do is generate a list of file names and the sheets within each one. I would like to use an array for this, but since I don't have much experience.... well....that's why I'm here. Can someone point me in the right direction?

2) And the second part of this.... I was planning on using the FileSystemObject to determine the files in a selected folder and loop through that list of files, opening each one and harvesting the required info (file name and all sheet names). Should I use the FSO or is there something built into Excel that might be better (and also limit the number of dependencies for this little "project" of mine).

View 9 Replies View Related

Create Workbooks From Sheets & Append Current Date To Saved Names

Apr 22, 2008

I have a workbook with multiple worksheets. First 4 tabs are the standard tabs and rest of the tabs are created based ona macro with the unique names. Now i want to create the separate workbook for each tab by its name and , date and time stamp in a C directory.

View 5 Replies View Related

Save Workbooks As Sheet Name

Aug 10, 2007

I have some code that basically searches through one Master Sheet (that the user will change each month) and based on some criteria, copies and pastes data onto 12 other sheets.

I was wondering how i make it so that the 12 sheets will save automatically as a different name depending on the date given on the original master sheet. For example, Master Sheet will have a cell that says September 07 and i want to save each of the other 12 sheets as "Name1_October 07", "Name2_October 07", etc. Is this possible to do while keeping the original Master Sheet along with the other 12 originals?

View 8 Replies View Related

List Sheet Names From Opened Workbooks

Dec 2, 2006

This code loops through all columns in all sheets in all workbooks of a specified directory.

My copy paste to column C in "Loop Folder" works well thanks to this forum especially wigi

I want to paste the file name once in Column A and have it repeat for each new file opened. My code only does this for the first one as I simply can not fathom the coding

In column B I'd like to paste the sheet name once as they get opened.
I am struggling here as well on Sheets.Name coding ....

View 9 Replies View Related

Save Each Sheet As A Text File With Incrementing Names

Apr 21, 2008

Want to do something *almost* exactly like a previous post but that post is now closed. Extract Each Sheet To Text File & Save as Sheet Name .txt` I want to extract data from individual worksheets from a workbook in excel to individual text files with the **same name as the original excel file** plus incrementing suffix.

Example: File_Name.xls with worksheets: Sheet1, Sheet2, Sheet3
==> Result...... File_Name_01.txt, File_Name_02.txt, File_Name_03.txt

don't delete - this is not a duplicate post. Previous code 1) creates text files with "sheet name" as was the original post's intent (not "file name") and 2) it does not iterate through each sheet (only processes Sheet1 regardless of selected sheet in the workbook)

Sub wsToText()......................

View 3 Replies View Related

Create New Sheet From Template - Problems With Names

Nov 15, 2007

I have 8 different workbooks which is 100% similar. Only values registred on each sheet is different. the format and rows/columns are the same.

The sheets is something that changes, when I want to improve layout etc.
I have one Template book where I do the changes and try to export this to the other books (call it upgrades). For macro moduls it works nice, just replace.

The problem is the sheets. When I have changed a sheet, replace it, it would not adopt values from the other sheets.

Ex. In sheet 2 I have named the cell 'B60' for U_KU in the new sheet 1 I expect at using =U_KU in cell I7 would adopt the values from B60 in sheet 2. But nope.

I can see that there is an link to the template workbook in edit ->linkage. Would this cause problem?

View 2 Replies View Related

Create And Name Folder And New Sheet Then Save

Jul 6, 2013

I'm having a little trouble making this code work correctly. This macro, Once finished, is connected to a (Save) command button. Here is what is suppose to happen, First thing to remember is another sheet (Sheet1) has been populated with various information which is used as a receipt. The information came from sheet2. I need to copy sheet1 just as it is, format included, create a new empty sheet, paste the information into the new sheet, name the new sheet with the values from cells in sheet2, E3, D3, and the date formatted as the month and year only. Then I need to create a folder in the my documents folder named from the values from sheet2, E3, D3, and todays date with the current time. If the folder already exists, then I just need it to change to that folder, and save the newly created worksheet (as named above) into that folder. After the save is executed, I need to delete that new sheet from the current workbook. Then I need to return to sheet2 to the last active cell and run the last few lines of code which collects the value of the cell 1 to the right of the active cell and transfers it to the cell 1 to the left of the active cell.

VB:
Public Sub Button11_Click()
Dim wShell, fso, strFldr, xdir As String
Dim newbal As String

[Code].....

View 9 Replies View Related

Auto Create Folder And Save A1h20 Data As Reports Sheet

Dec 19, 2008

i want to create folder depending on cell value a1 select data from a1 to h20 save this as "b1 value.xls" my saving directory is c:

eports"a1value" ....

View 9 Replies View Related

Create Dropdown That Will List All Names Starting With Initial Letter Of Names?

Jan 13, 2014

I have a long customer listing, names 5 to 36 characters and several with their location in the name as well as a few common duplicate names. I am trying to produce sheet where the customers name once selected opens in the customers spreadsheet and data can be added/amended for sales etc.The lists are not in alphabetical order as when created a customer number is automatically allocated. My aim is just to type in the first letter of the name and the dropdown appears the customer is selected and their card appears. I have tried data validation, lookup, vlookup, Dropdown and Match/find. they only return the first record found and no sign of any others. Find returned all instances of the letter appearing in every name.

View 9 Replies View Related

Command Button - Create A Save Button In Sheet 1?

Mar 9, 2013

i want to create a save button in sheet 1, on clicking the same the data entered in the particluar cells of sheet 1 should get saved in sheet 2 in given format

View 1 Replies View Related

Excel 2010 :: VBA - Hide Sheets Using Code Names Not Sheet Names

Oct 15, 2013

Code:

Sheets(Array("Sheet 1", "Sheet 2")).Visible = False

How do I convert the above to using Sheet Codes Names, Sheet1 and Sheet2?

Want to ensure my code will work if the user changes the sheet name.

View 2 Replies View Related

List Sheet Names And Internal Names Within Workbook

Feb 25, 2011

Is it possible to produce a list on a new worksheet of all sheet names and their their internal names within a workbook?

If so I would like the tabbed name's to begin in say A2 with the corresponding internal name in B2.

View 3 Replies View Related

Using Defined Names From Different Workbooks?

Sep 15, 2014

Is it possible to use defined names from other workbooks? I would like to use this defined name as part of a VBA code.

Example: ActiveChart.SeriesCollection(1).Values = Range(Name1)

where Name1 is a defined name from a different workbook

View 3 Replies View Related

Defined Names In Workbooks

Feb 24, 2009

I am currently overhauling a massive workbook, that previously relied on an absurd amount of named ranges in order to run vlookups. I no longer need these named ranges and would like to delete them to unclog the workbook. Currently I only see a way to delete them one by one. Is there a way to mass delete all of them?

View 9 Replies View Related

Merge Workbooks With Same Names

Feb 3, 2007

Each month I run 2 separate reports and have macros that break each report out by distributor. The end result is each spreadsheet creates a new tab and new workbook for each distributor’s information. Each spreadsheet has information for 30 distributors, so I end up with 60 new tabs and 60 new workbooks.

Example:
Spreadsheet one separates detailed sales information for:
Abc Company
123 Company
Misc. Company

Spreadsheet two separates summary sales information for:
Abc Company
123 Company
Misc. Company

Currently, I save each spreadsheets new workbooks in a different folder because each spreadsheet creates workbooks with the same distributor name. I then go back and open each spreadsheet with the same name and move a sheet from one workbook to the other and resave. Now I am trying to figure out the best way to merge these back together and am struggling with where to start.

I could keep opening each of the 2 new spreadsheets that are alike and copy or move sheets but with 30 new tabs to move to the matching spreadsheet it becomes time consuming. I’m hoping there’s a better way!

I’ve attached the Sales Detail Example and Sales Summary Example to see how the spreadsheets are being broken out but had to remove some data to trim down file sizes.

View 9 Replies View Related

Range Names Between Workbooks

Jun 21, 2007

In one workbook, i have a sheet with date like this:

TITLE
Data......

TITLE2
Data2....

In each case, the Data is a block of cells of varying number of columns and rows. Each of the data blocks is a named range. When I reference the ranges from a separate workbook, the results from calling the range don't work at all (return #VALUE!) UNLESS the layout of the second workbook is the same as the source data! so for example, if range Data is in cells A2...F5, then i can reference that data ONLY if i put my formula in cell A2...F5 on the second workbook. this appears downright ridiculous to me and i'm hoping someone can tell me what i'm doing wrong!

View 5 Replies View Related

How To Make Same Macro Run On Workbooks With Different Names

Apr 15, 2013

I tried recording a macro to automate some tasks I perform every day between two workbooks. While in one I want to go get data from the other. The problem I'm having is the name of the workbooks I want to run this on changes every time I download my data into Excel. The files always start with the same name but the date gets appended to it. Is there a way to modify the macro to just work with the two books I've got open?

View 3 Replies View Related

Linking Names To Closed Workbooks

Feb 14, 2007

I've named some cells in the source workbook, and linked these names to the destination workbook. Then I used the names in some formulas in the destination workbook, and it worked great. But when I closed the source workbook it doesnt work. WHen I open the source it works great, but I need for it to be able to link to the workbook when it is closed as well.

View 9 Replies View Related

VBA Macro - VLookup From 2 Workbooks With Changing Names

Feb 17, 2014

I have a user which needs to run a vlookup daily. There is some formatting involved, especially with 2 exported workbooks...

So I wanted to make her a macro to do it. So she exports 2 workbooks where the names change based off the date range she runs the data for.

I was thinking I wanted her to close excel completely, then run them in a specific order and do the vlookups based of Index Numbers.

I can do the entire macro except for the syntax of the vlookup. I think if i write what I need, you guys could put it in proper syntax:

=Vlookup(RC[-10],Workbooks(2).Sheets(1).Range(A:A),1,false)

View 2 Replies View Related

Close Workbooks (with Variable Names) Without Saving

Mar 7, 2014

I have completed a long macro, and at the end of the macro I want to close a few workbooks automatically without saving. These workbooks have been assigned variable names.

Is there a command line I can use, that will not prompt the user to save?

Variables:
MARM_fileNM
MARC_fileNM
MAKT_fileNM
Temp_fileNM

View 3 Replies View Related

Retrieving Data From Other Excel Workbooks With Various Names (without VB)

May 28, 2014

I would like to create a summary for the ordering history of each customers. The IT department will facilitate us to generate some raw data and I want to retrieve the data to the summary excel when I type the Ref No of the customer.

For example, I have the following raw data generated, in which the file name is "A123456":

Ref No
Name
Address

[Code]....

And I want to extract the data to the following summary. When I type "A123456" in the field "Ref Number" in this summary, it will automatically retrieve data from the corresponding raw file:

Trading Summary
Ref Number:
A123456

[Code]....

View 3 Replies View Related

Switching Between Workbooks Whose Names Are Stored As Variables

Jul 20, 2006

I'm having trouble finding a way to switch between two workbooks that I have open whose names are stored as variables. If the variable name were variable, for example, I have tried the following:

workbook(variable).activate
workbook.activate variable
workbook(variable).select
workbook.select variable

none of these work and I've tried a ton of other ways to get it to work but I just can't figure it out!

View 8 Replies View Related

Open Multiple Workbooks With Variable Names

Aug 17, 2007

I have data spanning many files which are named with the date on which they were created (so there are 31 files for August).
For example:
PL080107, PL080207, PL080307, PL080407...)

I'm trying to compile all of my data into one workbook, and have the macro to append each file to a list. Now I need the macro to either OPEN each file, or ACTIVATE each file so that the rest of the Macro can grab the necessary data.

I say Open or Activate, because I can MANUALLY Open a full month's worth of files if it's easier code. If not, I would like it to open and close each workbook on its own.

I have over 7 month's worth, so opening 31 files 7 times is better than opening over 200 files individually!

View 5 Replies View Related

Create A List Of Unique Names From A List Of Multiple Names

Oct 21, 2009

I have a database output file where one of the columns contains managers names, often more than once. I want to apply an autofilter on manager name and then copy the result to another sheet or sheets. My criteria for the autofilter is a variable pointing to a list of names that at present I maintain by hand; a for-each-next loop then cycles through the names.

What I would like to do, before running the autofilter code, is to create the list of names via code. This would then automatically pickup names that are missing.

The code I have so far is below:

Public Sub find_managers()
Dim managers1 As Range
Dim names1 As Range
Dim n1 As Variant
Dim n2 As Variant

In my mind it should check the names in the unique list against the imported list and add any missing names.

View 9 Replies View Related

Save All Open Workbooks In Xls

Dec 2, 2009

I am using a macro to open .txts in excel in seperate workbooks

I look for a macro to save all open woorksbooks in .xls

View 12 Replies View Related

Save All Workbooks In Folder As CSV

Oct 22, 2013

I am using this code to save all files in folder as CSV . I would like to add a letter to the beginning of file name for each file starting with a for file 1, b for file 2 etc.

Code:
strFile = Dir(mFolder & "*.xls*")
Do While strFile ""
Workbooks.Open mFolder & strFile
Range("D1").EntireColumn.Insert

[Code] .........

View 2 Replies View Related

Produce Numerous Workbooks Based On Filtered Names

Oct 25, 2012

I am trying to produce numerous workbooks based on a filtered name. I will attach a sample spreadsheet that has the data.

On the sheet we have engineer names. I basically want to filter them (not difficult with a macro) but then to copy the results to a new spreadsheet and save the workbook as the engineers name (ie J. Bloggs has 5 jobs so they are filtered and the results are dumped into a new workbook and then saved as J. Bloggs.xls). This will happen for all engineers.

I have though about doing it as a macro and I think that would give me the end result but we have around 20 engineers and these can sometimes go up and down. Is there anyway to do this automatically?

Test Cost report 1.xls

View 6 Replies View Related







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