# 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?

## Split Percentages Into Groups Of 10 For 5 Segments

Jul 11, 2014

I have a percentage based input whose values can change, example:

Input matrix.png

I would then like this translated into a matrix that can adjust depending on the segment % input; like so:

Matrix.png

## Transpose Multi-Column Groups/Repeats Based On 1 Column

Mar 19, 2009

I have a sheet with 3,000 rows and only two columns. Column "A" consists of 20 to 30 different names, column "B" consists of 50 to 60 different products. I need to be able to evalute the value in column A and copy, paste special transpose all values in Column B that have the same value in column A. As an example if cells A1 through A5 is "Arizona" and cell B1 is Broccoli, B2 is Cauliflower, B3 is Apples, B4 is Oranges, and B5 is Bananas, I want to copy B1 through B5 and paste special transpose to cell C1.

This then would need to loop all the way to the bottom of the data in Column A looking for a change in value. The attached file called Sample Data has two tabs. The one titled "report" shows the raw data, the one titled "Final" shows how I would like the results to appear (column L)

## Create Worksheets Based On Data Groups In Column

Apr 10, 2008

I have a workbook that lists system analysts and information on the systems they're responsible for. I would like to have an Excel macro that will:

1. Create and name a new worksheet for each UNIQUE value in the 'Name' column (new worksheet for each analyst)
2. Copy their system info to each respective worksheet

I've attached a sample workbook.

## Formula To Split Text Into Groups Of 30 Characters But Control As Well

May 28, 2014

I have previous been given the below macro from here that splits a string of text in one cell into groups of 30 and then puts them into several cells, works perfectly.

What I would like to incorpate now is the ability to overide the point at which it splits the text.
i.e. if the inputter puts a "|" (for example) in the original text, this will cause a split in the text and it will restart its 30 count from this point onwards.

Example of what I would like to achieve:

Cell A1 = I would like to change this string of text into groups of 30, where this appears | I would like it to start a new split of 30s from this point on wards and again if another one of these | appears in the text.

Cell B1 = I WOULD LIKE TO CHANGE THIS
Cell C1 = STRING OF TEXT INTO GROUPS OF
Cell D1 = 30, WHERE THIS APPEARS

[Code]....

## Fill Range With Sequential Numbers Based On Corresponding Column Groups

Feb 15, 2010

In the attached workbook I'm trying to populate Column E with sequential numbers (as shown) based upon a changing range (defined as a named range called 'range'). Is it possible to write a formula in the cells in Column E that will do this?

## 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.

## 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.

## 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.

## 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.

## 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.

## 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.

## 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] ......

## Weighted Count Of Specific Segments In A Cell

Apr 3, 2009

I need to counting formula (I'm calculating weighted frequency of specific letters). My data is as follows:

A1 "lingual"
B2 "28"

The formula needs to look at the word in A1 and count the number of times a given letter (e.g., "l") appears in the cell (any position), and then multiply the result of the count by the value in B2. In the example above, the answer should be 56 (the letter "l" appears twice in "lingual", so it's 28X2).

## 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.

## Macro To Split Rows Into Groups Of 5 And Insert 3 Blank Rows In Between

Feb 9, 2013

I would like to have my macro code search column A (supplier numbers) and split the rows into groups of rows of 5 or less and then insert 3 blank rows between each group of rows. The split needs to start on a new supplier number and cannot split a supplier number into two different groups. Here is a sample:

Supplier
Invoice Date
GL Date
Invoice Amt

[Code].....

## 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

## Copy Cell Value To Different Column Same Row Based On Condition?

Oct 13, 2012

I've schedule header date 1-oct,2-oct,3-oct.....etc and have two cells Last Date and Hours I need from those cells once i add date and hours to copy the hours and paste in schedule header in the exact date..

for example
#
Last date
Last Hours

[Code]....

but was too slow takes long time.

2nd VBA code to copy last hours to schedule date based on condition on last date cell.

## Copy Formula Down Based On Last Cell In Another Column

Jan 17, 2008

i want to insert value from the name of file from this formula "=MID(CELL(""filename""), FIND(""["",CELL(""filename""))+1,10)" to range b2 until last empty range that i found form this formula =ROW(OFFSET(A1, COUNTA(A:A)-1,0))

Sub lumu()
Dim x As Variant
x = "=ROW(OFFSET(A1,COUNTA(A:A)-1,0))"
Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B1").Select
ActiveCell.FormulaR1C1 = "kode_wilayah"
Range("B2").Select
ActiveCell.FormulaR1C1 = _
"=MID(CELL(""filename""),FIND(""["",CELL(""filename""))+1,10)"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2", Range("B" & x)), Type:=xlFillDefault 'this an error
Range("B2:B123").Select
On Error Resume Next
ActiveSheet.Name = "t"
End Sub

## Search Column For Cell Starting With X Then Copy Row To A New Tab Based On A Cell Value

Jan 13, 2014

I have an tab with 20,666 rows that I need to separate into different tabs based on what a cell in a specific row starts with.

Data Tab
001-020-002-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-005-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-006-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-007-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447
001-020-008-000 Walker River Irrigation DistPO Box 820 YeringtonNV89447

[|Code]...

So what I am looking to do is search the APN row in the Data Tab that starts with the number from the APN # row in the APN Tab and then copy the row to a new/existing tab named after the Description on the APN Tab.

I think that I have explained what I need to do

## Macro To Split And Remove Based On Cell Value

Apr 18, 2014

This is my input:

Col A
asde,dsfts-qwsa/001,asdasd-qwsa,asdas
etert,ttyutt-tww/013,dgdd-tww,dsfsaa
.
.
.
.
.

Col B
qwsa
tww

In Col C.. I want the output to be as
asde,asdas
etert,dsfsaa

Requirement as a text:

I need a macro that removes the value in column A based on the value in Col B.

The data that the macro removes is always between the "," (comma).

## Split Cell W/o Text-2-Column

Apr 7, 2008

I have a cell that has this in it:

"5+5"

That's how the data arrives to me. I would like to have another cell display the result (i.e. 10) so I won't need to calculate everything by hand. How can I do this with a formula? I don't want to use text-to-columns, and I'd prefer not to use VBA.

## Copy Cell Values To Another Sheet Based On Text In A Column

Apr 11, 2014

I'm creating a workbook to keep track of my utilities payments, one sheet for one utility and so on. I like to copy two cells from each sheet to another one to keep me updated of the amount to pay and the date. an example: column A with text, if text "NEXT" appear in column A, copy the value of two cells (at columns B & C) at the right of "NEXT" to another worksheet, if that possible? Below is a photo as an example:

excel.jpg‎

## Excel 2010 :: Copy Contents Of Column Based On Value In Another Cell

Jul 30, 2013

I'm using excel 2010 and windows XP with a moderate amount of experience tinkering with macro programming. I know what I need is very doable but I can't get my head around what the code would look like. I must not be wording my searches correctly because most of what I'm getting for results are iterative programs based on a cells value which isn't what I need.

I'm trying to build a macro that will check a cell (C3) and based on the contents of that cell copy a column (I) to one of 12 different columns (K:V). So if the value in C3 is 1 it should copy I to K, if the value is 2 it should copy I to L, and so on.

## Copy & Paste Specific Column Based On Cell Reference

May 20, 2008

I've searched for a solution on the board and the internet too but to no avail; I am trying to create a macro that will select the entire column based on a cell reference G1 which is infact a Date.

Column G to Column S are pre-defined with a specific Date in row 8. If the Date in one of these columns (G8 to S8) match with the Date in cell G1, say it finds a match with H8, then I want to copy the range F14:F2000 and paste as values in range H14:H2000. The possibility of a match found is limited to a single columns from G to S.

## Split Single Cell Into 2 Column X 3 Row Range

Mar 25, 2008

I'm trying to separate a cell containing:

TSB w/6.5% NaCl - NS 29002TSB w/6.5% NaCl - NS 29003TSB w/6.5% NaCl - NS 29004

into a 2x3 table, in another sheet, like this:

TSB w/ 6.5% NaCl NS 29002
TSB w/ 6.5% NaCl NS 29003
TSB w/ 6.5% NaCl NS 29004

TSB..... in left column and NS...... in right column. This example includes 3 items as shown above but the single cell could contain more or less than 3 items

## Copy And Paste Range Of Cells Based On Number Of Cell Values In Column A

Mar 17, 2014

Please see attached sample worksheet. Column A will be generated by the user manually.

I'm looking for a way in VBA to have A1:D20 in Sheet2 copied and pasted in the "Bank Reconciliation" Sheet based on how many "Markets" there are in Column A. Then, once that's complete to have A22:D30 (the smaller box in Sheet2) copied and pasted directly below those results.

I have what the macro would hopefully generate to the right in "Bank Reconciliation" (B6:E54) as an example. So if there's a market in A1, copy and paste the box to B6. If there's a market in A2, copy and paste the box directly below the first (B26) etc. etc. until it's done, then paste the smaller box directly below whatever the macro generates.

Book2.xlsx‎

## Excel 2010 :: VBA Macro To Split Text In Every Cell Of The Same Column?

Apr 16, 2014

Excel VBA 2010.

I have this problem:
e.g Cells ""
C2 - 128.50 g
C3 - 211.01 g
C4 - 198.50 g
C5 - 179.34 g

I need to split the text into
Cell "C2" = 128.50 and Cell "D2" = g
Cell "C3" = 211.01 and Cell "D2" = g
and so forth

I wanted to avoid using delimited method with space and induce an automated method to format every cell of Column "C" one by one.

## Copy Groups Of Data

Apr 22, 2008

I have this an excel file which contains about 500-800 entries. These entries have about seven 0's which denotes where the data starts for a each group. In order to separate the data, I want to copy and paste this data to other workbooks. What would be the best way to select the rows from one 0 to the next?

## Copy And Paste From One Sheet To Another Based On Column A Using A Macro Copy Button

Jan 22, 2007

I want to copy and paste from one sheet to another based on column a using a macro copy button.

E.g. if column a value = apple then copy that row into the apple sheet.