Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a massive list of raw data that I am wanting to put into individual
sheets. i.e All those rows that start in column A with Powercar1 into sheet called Power, same for WaterCar1 into Water etc. Snip it below of data Is this possible.....I've had a look at the forum and can't find any clues to help me. I'm not wanting to copy and paste If I put a formula into the first column of each sheet to lookup the reference, I get the same data repeated...........it does not bring each in. If necessary data can be added to the raw data if it helps putting it into seperate sheets. Please help Column A Column B Column C POWERCAR0 36 WF05XXGBB56T88939 POWERCAR0 36 WF05XXGBB56T89898 BTCAR0 35 WF05XXGBB56T89963 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y39111 WATERCAR1 117 WF05XXGBB56Y39978 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y40092 POWERCAR1 111 WF05XXGBB56Y45247 POWERCAR1 96 WF05XXGBB56Y48127 AFFILIATESCAR1 106 WF05XXGBB56Y48299 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I take it that the sheet names are the entries in Column A to the left of
"CAR". Is that right? Are all the sheet names included in your snippet of data? Do all the sheets already exist? I also take it that you don't want to change the original list of raw data, that you want to just copy it. Is that right? Otto "holyman" wrote in message ... I have a massive list of raw data that I am wanting to put into individual sheets. i.e All those rows that start in column A with Powercar1 into sheet called Power, same for WaterCar1 into Water etc. Snip it below of data Is this possible.....I've had a look at the forum and can't find any clues to help me. I'm not wanting to copy and paste If I put a formula into the first column of each sheet to lookup the reference, I get the same data repeated...........it does not bring each in. If necessary data can be added to the raw data if it helps putting it into seperate sheets. Please help Column A Column B Column C POWERCAR0 36 WF05XXGBB56T88939 POWERCAR0 36 WF05XXGBB56T89898 BTCAR0 35 WF05XXGBB56T89963 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y39111 WATERCAR1 117 WF05XXGBB56Y39978 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y40092 POWERCAR1 111 WF05XXGBB56Y45247 POWERCAR1 96 WF05XXGBB56Y48127 AFFILIATESCAR1 106 WF05XXGBB56Y48299 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is a macro that will do what you want. For this macro to operate
correctly the following conditions must exist: The active sheet is the sheet that contains your raw data. The raw data is in Columns A:C as you said. There must a list of all the sheet names in some column of some sheet in your file and that list must be named "SheetList". Note that this macro copies Columns B:C and pastes that data into Column A of the appropriate sheets. Sub CopyData() Dim ShtName As Range Dim RngColA As Range Dim i As Range Dim Dest As Range Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp)) For Each ShtName In Range("SheetList") With Sheets(ShtName.Value) Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) For Each i In RngColA If Left(i, Len(ShtName.Value)) = ShtName.Value Then i.Offset(, 1).Resize(, 2).Copy Dest Set Dest = Dest.Offset(1) End If Next i End With Next ShtName End Sub "holyman" wrote in message ... I have a massive list of raw data that I am wanting to put into individual sheets. i.e All those rows that start in column A with Powercar1 into sheet called Power, same for WaterCar1 into Water etc. Snip it below of data Is this possible.....I've had a look at the forum and can't find any clues to help me. I'm not wanting to copy and paste If I put a formula into the first column of each sheet to lookup the reference, I get the same data repeated...........it does not bring each in. If necessary data can be added to the raw data if it helps putting it into seperate sheets. Please help Column A Column B Column C POWERCAR0 36 WF05XXGBB56T88939 POWERCAR0 36 WF05XXGBB56T89898 BTCAR0 35 WF05XXGBB56T89963 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y39111 WATERCAR1 117 WF05XXGBB56Y39978 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y40092 POWERCAR1 111 WF05XXGBB56Y45247 POWERCAR1 96 WF05XXGBB56Y48127 AFFILIATESCAR1 106 WF05XXGBB56Y48299 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Otto
Many thanks for that. Couple of pointers as I'm newish to coding. I have the sheets already created i.e Power, Water etc. The data i need moving from the raw data to the relevant sheet is from column M to BF. WHn i have tried to run this, I get the debug error at 'For Each ShtName In Range("SheetList")'. Do I need to write the names of the sheets into the coding Please help as I really would like to uderstand this, and this will help for future stuff I need to do "Otto Moehrbach" wrote: Here is a macro that will do what you want. For this macro to operate correctly the following conditions must exist: The active sheet is the sheet that contains your raw data. The raw data is in Columns A:C as you said. There must a list of all the sheet names in some column of some sheet in your file and that list must be named "SheetList". Note that this macro copies Columns B:C and pastes that data into Column A of the appropriate sheets. Sub CopyData() Dim ShtName As Range Dim RngColA As Range Dim i As Range Dim Dest As Range Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp)) For Each ShtName In Range("SheetList") With Sheets(ShtName.Value) Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1) For Each i In RngColA If Left(i, Len(ShtName.Value)) = ShtName.Value Then i.Offset(, 1).Resize(, 2).Copy Dest Set Dest = Dest.Offset(1) End If Next i End With Next ShtName End Sub "holyman" wrote in message ... I have a massive list of raw data that I am wanting to put into individual sheets. i.e All those rows that start in column A with Powercar1 into sheet called Power, same for WaterCar1 into Water etc. Snip it below of data Is this possible.....I've had a look at the forum and can't find any clues to help me. I'm not wanting to copy and paste If I put a formula into the first column of each sheet to lookup the reference, I get the same data repeated...........it does not bring each in. If necessary data can be added to the raw data if it helps putting it into seperate sheets. Please help Column A Column B Column C POWERCAR0 36 WF05XXGBB56T88939 POWERCAR0 36 WF05XXGBB56T89898 BTCAR0 35 WF05XXGBB56T89963 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y39111 WATERCAR1 117 WF05XXGBB56Y39978 GOVERNMENT DEPARTMENTSCAR1 117 WF05XXGBB56Y40092 POWERCAR1 111 WF05XXGBB56Y45247 POWERCAR1 96 WF05XXGBB56Y48127 AFFILIATESCAR1 106 WF05XXGBB56Y48299 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving a line chart data point revises data table value in Excel ' | Charts and Charting in Excel | |||
Moving Data between sheets in the same workbook and moving data between Workbooks. | Excel Worksheet Functions | |||
Moving data from one worksheet to another whilst removing the data | Excel Discussion (Misc queries) | |||
moving data to non autofarmatted book changes data- Why? | Excel Discussion (Misc queries) | |||
moving data in excel without deleting existing data | Excel Discussion (Misc queries) |