Split Up Rows In Worksheet Based On Value In Column And Rename New Sheet To Same Value

Jul 9, 2012

I'd like to split up the rows in a worksheet based on the values in one of the columns. Also, I'd like the sheets to be named after the values in the column. I have attached example excel sheets to explain this better. I think the vlookup and Sheets.Add and ActiveSheet.Name formulas can be used but I'm not quite sure how to put them together. The actual data has about 20 columns and about 500 rows.

View 6 Replies


ADVERTISEMENT

Excel 2007 :: Split Sheet Into Workbooks Using Workbook Template Based On Data In Column A

Oct 5, 2011

I have a workbook that has a sheet called CustInvData, this sheet contains 4,421 rows of invoice transaction data for 178 customers starting on row 2 (headers on row 1). I need to split the transaction data for each customer out into a workbook template based on the customer name in column A. I need each workbook named by the customer name along with a month and year (example: Bellsouth-0911.xls), this should create 178 unique workbooks. And since we sometimes have to go back and rerun invoices for previous months, I'll need to control the month and year manually in the code.

The parsed data needs to be copied to a pre-formatted invoice template. This template has 2 sheets, Sheet1 is called 'Product Summary', this is a table that uses VLOOKUP functions to read the data in Sheet2 called 'Product Details', this is the sheet the parsed data needs to be copied to for each customer invoice. The 'Product Details' sheet has formatted rows 1 thru 11, row 11 being the header row for the data from CustInvData to be copied. So the parsed data needs to start at row 12.

Last, once the data has been copied into the 'Product Details' sheet, I need the data to be SubTotaled at each change in column J (Product) and use the 'Sum' function to add a Subtotal in column L (Retail Price) for each unique product category.

Example data below, I've simplified it (the actual data array spans from columns A to Y)

Customer NameProduct Retail Price
ABC CompanyAVMPCR10
ABC CompanyAVMPCA15

[Code]....

I'm a bit of a novice with macros, but I know Excel pretty well.

Using Excel 2007 running on Windows Vista

View 2 Replies View Related

Formatting Worksheet: Re-adjust The Worksheet To Make It More User Friendly Based On Number Of Rows In Current Sheet

Oct 14, 2008

I have a worksheet with 30,000 rows. But sometimes even if I have fewer records in this worksheet(lets say 1000) worksheet shows the same 30,000 rows.And its annoying when you try to navigate using vertical scroll bar. Is there any option to re-adjust the worksheet to make it more user friendly based on number of rows in current sheet.

View 2 Replies View Related

Macro That Will Rename A Worksheet Based On The Value Of The Cell?

Jul 28, 2008

Is it possible to write a macro that will rename a worksheet based on the value of the cell?

For instance, if cell a1 has the value Test, the worksheet should be named Test. If I change the value of the cell to say Test 1, the worksheet should automatically rename itself to Test 1.

View 9 Replies View Related

Rename Files Based On List In Worksheet

Nov 10, 2006

I regularly receive many files that require renaming. Column A contains the current name and column B contains the desired name. Could anyone tell me how to use these lists to rename the files?

View 4 Replies View Related

Automated Worksheet Copy, Rename Based On Cell Results

Jul 29, 2009

I am building a workbook. The data we are tracking is all in one xml file, which i have mapped to 3 different worksheets(customers, invoices, inventory). On the customers and inventory sheet I have an interface for creating a new customer/product/invoice. I used the macro recorder to make the macro's to do these three things, but could use help on a couple of other functions as I don't actually know VBA. I need to be able to automate editing of existing records by having a button to press on the each sheet that will open an input box that asks the user which invoice number, customer number or product number he would like to edit, then copy that record to the interface for editing, then another macro to replace the existing data with the newly edited data. It would also be wonderful if when creating or editing an invoice it could create a copy of the interface worksheet and rename it as the invoice number. The first row of each datasheet is blank, and each of the interfaces have formula's for importing the information copied to row 1 from the data tables. the second row of each datasheet contains formulas for importing data from the interface. Any help would be terrific...I know you guys are excel gods and I will forever be in your debt if you can help me out....thanks in advance, I'll be studying my butt off until I figure this out

View 11 Replies View Related

Copy Sheet And Rename Based On Date

Dec 31, 2008

I have a spreadsheet that I enter daily totals into. The sheet is named by date.
I take totals from a number of catagories from the prior day's sheet (ending totals) and enter them on the current sheet (beginning totals), then enter the current day's totals to wind up with new ending totals.

I want to generate a new sheet in the same workbook based on the date of the prior sheet, copy my formatting, and copy the data from the old ending sheet totals to the new sheet beginning totals.

View 4 Replies View Related

Rename A Sheet Based On Cell Data

May 17, 2008

I'm looking for a solution that will rename the sheet to whatever is enterd into particular cell.

Ie: cell A1 = "Joe Bloggs", then the sheet is renamed to Joe Bloggs

Also, on the same sheet, is it possible to change the sheet tab colour based a data in a different cell?

Ie: cell B1 = "Parts", then the sheet tab colour changes to pink.

View 14 Replies View Related

VBA To Copy Sheet And Rename Based On A Table

Apr 22, 2013

I have a macro which does the following:

1) Copies Sheet2 for each name on the list. Sheet1 has the list of names (cells A5:A10)

2) Renames each sheet with the next name on the list

3) In each of the copied sheets in cell A2=newsheetname

Sub Copy_Sheets()
Dim i As Integer
Dim wks As Worksheet
Set wks = Sheets("Sheet1")
For i = 5 To 10

[code].....

This works like a charm for this particular list. The thing is, I want to take this macro and apply it to a variable list. In one instance the list may be in cells A5:A10, and in another instance it may be in cells A5:A100. How can I update my macro so it looks for the next name in the list and stops when there is no longer a name.

View 2 Replies View Related

Rename 500 Sheets Based On Modified Cell Value On Each Sheet

Jul 31, 2013

I receive a workbook each day with approx 500 tabs of call data and I would like to relabel all the tabs with the user names. The user names are in a merged range "A7:M7". I'm having difficulty getting the following script to rename the sheets. Currently the values in "A7:M7" look like "User: ADAM ENGEMANN-558".

I am trying to delete each occurrence of "User: " while naming the sheets as well as removing the merged range before doing so that the names are in A7 only. The sheet names should look like "ADAM ENGEMANN-558", or, ideally just "ADAM ENGEMANN". For some reason my code will not modify the cells. (See attached example)

This works if I manually unmerge the cells before running and remove the ":".

VB:
Sub RenameSheets2()
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
If ws.Range("A7").Value <> "" Then

[Code] .....

This his how I modified it but it doesn't work on the supplied sheets. Please note that if I manually insert some blank sheets into my workbook and merge the cells etc it does work. There seems to be something odd going on with the sheets they are giving me. (they aren't protected)

VB:
Sub RenameSheets2()
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
If ws.Range("A7").Value <> "" Then

I tried adding the following to remove the merged ranges and remove 'User: ' from the names
Range("A7:M7").Select
With Selection
.WrapText = False
.MergeCells = False

[Code] ......

CallSample2.xls

View 3 Replies View Related

Rename Excel Sheet Based On Cell Values?

Aug 17, 2014

I am having trouble creating a macro that renames all excel sheets using cells on Sheet1.

See attached, I want to rename all excel sheets (renamed as "1", "2", "3"....."50") as "9999", "10000", "10001"..."10045", found in Sheet1, renamed as "Base". I will change the cell values everyday (range Base!A5 to Base!50) - and will rename all the sheets again.

Before: before.jpg

After: after.jpg

View 2 Replies View Related

Split Worksheet, Seperated By Blank Rows, Into Several Worksheets

May 26, 2009

how to split one large worksheet into several worksheets using VBA. The only criteria I have to go on in the large worksheet is the existence of blank rows between each chunk of data I want on it's own worksheet.

Please see the attached zip file. There are 39 chunks of similar (but varying in number of rows) data that are separated by 3 blank rows, so I want my workbook be split into 39 new worksheets. My goal is to get the data into list/table format so I can work with it more easily and export into Access etc.

Also, just out of curiosity, is it possible to convert a HTM file into CSV? The attached data starts life as a HTM file that I just convert to XLS

View 6 Replies View Related

Rename Sheet And Hide / Unhide Based On Cell Contents?

Feb 10, 2014

I have a master sheet where users can change the name of 20 different sheets in the workbook by changing a cell value on the master sheet. Here is the code:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rCell As Range
If Target.Cells.Count > 1 Then Exit Sub

[Code]....

The next step which I am having issues with is hiding the sheets. I want all sheets in the workbook to be hidden except for the master. I only want the other sheets to be visble if the user inputs a name on the master sheet.

So if the cell contents on the master sheet, say "B9", is blank, the sheet in the workbook that corresponds to that cell will remain hidden. If the user inputs anything, say "Sheet1", in cell "B9" on the master sheet, I want that sheet to become unhidden and to be named "Sheet1"

View 2 Replies View Related

Click Button To Rename Sheet Tabs Based On Range

Jul 20, 2006

I searched a few times for the answer to my problem, using different search terms, but I've come up somewhat empty (this *might* be because I'm not up-to- speed with Excel's terminology?). Anyway, my problem is this: I have a workbook which is designed to track various data for a corporate training course ( sheets for attendance, grades, tool logins, etc). After all of these are sheets numbered 1-25 (we never have more than 25 students in a class, but usually around 20). The numbered sheets correspond to the student's number in the on the class list sheet (so, the first student would have personal "report card" information on sheet 1; the eleventh student in the class list would have their information on sheet 11, etc).

What I would like to do is have some way of putting a button on the class list sheet which would look at student list and rename the sheets to correspond to the student names. For example, if the fifth student listed was 'John Doe', it would rename his personal sheet ('5') to 'John Doe'. Obviously, I would need to do it for all of the students, and IDEALLY it would then get rid of any numbered sheets which are not used (having 21 students would only rename the first 21 sheets, but then hide sheets 22, 23, 24, and 25).

View 9 Replies View Related

Import CSV Into Worksheet Split Into Columns Then Copy Rows By Criteria

May 26, 2009

I have requirement to extact data into a spreadsheet. This data is extracted from CSV file which is huge normally over 7MB. I have found a macro on the internet which I have included with this post.

Sub split()
Dim ResultStr As String
Dim FileName As String
Dim FileNum As Integer
Dim Counter As Double
'Ask User for File's Name
FileName = InputBox("Please enter the Text File's name, e.g. test.txt")
'Check for no entry
If FileName = "" Then End
'Get Next Available File Handle Number
FileNum = FreeFile()
'Open Text File For Input
Open FileName For Input As #FileNum .................

I have also included reult data that I get after running the macro. I have cut down on data due to attachement restrictions. But usually there are multiple spreadsheets named "Sheet1, Sheet2, Sheet3 and so on". I have numerous requirements. First of all I want to be able to spreate data into columns. For now how I do that is by going to data -> text to columns and then selcting delmited and then selecting comma as my delimiter. Second thing I want to do is is only extract range of data from this output into a new worksheet. I am only interest in the name like for example ALBANY-Serial0/0/0 and data that is in the range of 8:00 AM to 6:00PM. So the new sheet should only have name and for that name data in the range of 8:00AM to 6:00PM for all the sheets "sheet1, sheet2 etc" until all data has been extracted.

View 7 Replies View Related

Copy Rows To New Sheet Based On Y / N Value In 1st Column

May 12, 2014

I have a single sheet that lists available items, prices, etc. When doing quotes, you simply put y/n in Col:A for each item. I then want a simple macro that will copy all of the rows with "yes" into a second sheet. Sample data with end result attached.

I did try and butcher this macro to do what I want, and whilst it does copy data across, it's not really working. Firstly as I think it is searching along a row and copy columns, whereas I need to search a column and then copy rows.

[Code] .....

Attached File : sample_data.xls

View 7 Replies View Related

Copy Paste Rows To Another Sheet Based On Column Criteria

Jan 17, 2007

I have a file that has two sheets, I have some formulas in the first sheet named "Data",What i would like to have is, If column G in the sheet Data is "Closed", then i want that particular row to be cut from the sheet " Data" and pated in to the Sheet "Done".

View 5 Replies View Related

Create Pivot With Worksheet That Has Split / Complex Column Headers?

Jul 3, 2014

it doesn't like the fact I have split column headers and I was wondering if there was a way around it or another solution to save me time manually counting or filtering. I can't attach the actual spreadsheet for some reason but attach a screenshot to illustrate what I mean.

I need to count the number of 1's, 2's, 3's etc in each 'On Exit' column for each area. I then need to work out what percentage of the cohort they each are.

View 9 Replies View Related

Copy Sheet Based On Table / Rename And Hyperlink Table To New Sheet

Jul 28, 2014

I've been working on a macro that makes copies of a template sheet based on a table in my Opps sheet. If column B isn't empty, make a copy of the template sheet, rename it to Opps column A, and then hyperlink column A's current A.row to the newly copied and renamed sheet.

I'm not sure what is wrong exactly, it keeps making duplicate Template(x) and stops renaming them, and the hyperlinks are not working. -This is my first go at VBA hyperlinks to internal workbook sheets

[Code] .....

View 5 Replies View Related

Split Column Into 2 Based On Space

May 20, 2009

I'm sure this is mighty easy, but I'm hoping to take Column A which currently has names written in it in the form "Joe Bloggs" and split it into two columns, "Joe" in Column B and "Bloggs" in Column C. All names are enterred seperated by a space.

View 2 Replies View Related

Split Sheet So As To Have Independent Column Widths

Oct 3, 2007

For the past 4 months I have been desperate to find a way to split my sheet so that I can determine the column widths above and below that point independently.

For example:

small width from a1-b1
but
really large width from a2-b2

Is there a way to do that?

View 9 Replies View Related

Split Single Column Into Multiple Columns And Rows

Aug 20, 2008

I have 300 rows worth of data that looks similar to this, all organized in one column:

John Q. Smith
Programmer
2111 NW 13th St
Anywhereville, USA, 55555
(555) 555-5555
Joe P. Snider
Organizer
5645 NW 45th St
Anywhereville, USA, 55555
(555) 555-5555
Patty Williams
Accountant
6454 NW 34th St
Anywhereville, USA, 55555
(555) 555-5555

As you can see it is consistent with the name, position, address line 1, address line 2, Phone number, for every single entry. All my names are already alphabetized so I don't have to worry about it. What I want to do is have the information for each entry translated into 5 separate columns so it looks like this.

John Q. Smith Programmer 2111 NW 13th St Anywhereville, USA, 55555 (555) 555-5555
Joe P. Small Organizer 5645 NW 45th St Anywhereville, USA, 55555 (555) 555-5555
Patty Williams Accountant 6454 NW 34th St Anywhereville, USA, 55555 (555) 555-5555

Supposing I started the sheet in the top left corner at A1, I was just going to have cell B1=A1 then Cell B2=A6 then just autofill down column B but it doesn't work. I have seen some people do something similar to what I want with VBA but I am convinced there has to be something simple in with an excel formula seeing as my information is already so organized and consistent.

View 4 Replies View Related

VBA Split Data Into Different Files Based On Column

Feb 27, 2013

I have seen this function Quickly split data into multiple worksheets based on selected column in Excel when searching for a solution. I would very much like to use VBA to filter data and open up new files in a similar way.

View 8 Replies View Related

Split Of Main Data Based On Column Into New Worksheets?

Apr 4, 2014

spliting of main data By column criterias which start from column E1:L1 something like Pivot Table in new worksheet, but based on formula functions.Each worksheets have to based in one of this column D1:K1 headings. That also have to rapidly change with main data table.

View 9 Replies View Related

Split Data Into Separate Worksheets Based On Column C?

Apr 11, 2012

I am looking to split data in a worksheet into separate sheets based on Column C which contains Either Babycare or Homecare or Industrial or Professional. Eventually there maybe more names. If possible I would also like to name each sheet.

My VBA skills is limited to this particular task.

View 2 Replies View Related

Split Data Into Multiple Worksheets Based On Column

Feb 4, 2008

I have a huge Excel spreadsheet going into the 10 000 mark.

What I want to do is split the spreadsheet into multiple worksheets based on the Company column.

I've attached a small sample.

View 4 Replies View Related

Split Into Multiple Sheets Based On Beginning String In Set Column?

Apr 12, 2014

I have used this code below to split a large excel file into multiple sheets from matching column data, but now I need to split it by a partial match (set number of characters from the beginning) from beginning of the column data.

For Example:

[Code]....

So with the code provided below using column 3 I would get 10 different sheets since none of the data in the column is identical. I want to modify the code (or come up with new code) so I can set the number of characters to compare from the beginning of the data in the set column and split into sheets based on that. So if I set it to the first 4 characters in column 3 I would receive only 5 sheets sheets: Safe, Fail, Dont, Poop, & 21-4.

What are the modifications or new code needed for this? I have searched for a bit with no luck, just keep finding code to check the full cell data for matches in a set column like this code I have:

SPLIT DATA FROM ONE SHEET TO MULTIPLE SHEETS

[Code] ......

View 1 Replies View Related

Split & Copy Groups/Segments Based On Cell Value In Column

May 6, 2008

This is my first post but I have been using Ozgrid for awhile now. I am farily good with excel formulas but have just started with macros so bear with me if i dont understand what you mean at first.

I am looking for a way to copy rows our of sheet2 in the attached sheet based on the value in the segments column in sheet 2. The rows need to be paste into sheet3 (already has heading set up). The segments value is the number of times i need each row copied into the next sheet. The purpose of this is to split random length samples into 10cm incriments for study. For example, a 1.5m sample is taken so there should be 15 segments of 10cm each copied into sheet3.

Also, if possible, it would be nice for it to display the actual length of the segment after copied into sheet3 for cases where the length was not evenly divisible by 10. I have found several examples of row copying macros, but none that will copy a conditional number of hte same row based on a cell value. In the original data there are close to 4000 rows, but the number of rows will vary depending on the data source.

Another thought I had was if the total number of available rows is going to be exceded would it be possible to have the rows pasted into different sheets based on the rock type listed in the column?

View 9 Replies View Related

Macro To Split Table Of RawData Into Individual Worksheets Based On Column C Value?

Jun 19, 2014

I am trying to divide a table of data (7 Columns, 500-1000'ish rows) into individual worksheets based on any unique values in column. There may be anywhere from 10-30 instances of the same value in Column C, and I need to bring all rows of each unique instance into a newly created worksheet to be labelled the same as the value in Column C.

The RAW data will be updated monthly by keeping a template file copying and pasting data, therefore I am hoping to have a "SORT" button with this Macro assigned to it. I have quickly thrown together a sample workbook with how the RAW DATA will be pasted into the file, with additional sheets showing how I would like the data split and organised.

View 2 Replies View Related

Count Rows In Column On Worksheet Then Insert That Many Rows On Another Worksheet

Nov 15, 2013

Count all the true statements in column A (Work) of sheet1 (Checklist), once counted insert that many rows on sheet2 in a specific location, I found a count formula just don't know how to do the insert rows part

Code:
Sub CountRows()
Dim Rng As Range, CountTrue As Long
Set Rng = Sheets("Checklist").Range("Work")
CountTrue = Application.WorksheetFunction.CountIf(Rng, "True")
End Sub

View 3 Replies View Related







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