Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hey right now I have a huge excel sheet with like 250 columns and
there are about 250 rows but I need the macro to go up to 1500 because I will be getting more data. In the column "i" I have different strings such as "Burger King". I need a macro that will copy every row in the sheet that is the value of Burger King in "i" for example to its own sheet entitled that value. Can someone help me out please? I tried a few things I found by searching but they didn't work. Thank you very much! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
DataFilterAutofilter.
Filter for Burger King on column I. Copy and paste the results to a Burger King sheet. If you need code for copying, adding a sheet and pasting try Ron de Bruin's site for methods. http://www.rondebruin.nl/copy5.htm More on Copying, Pasting and Merging at Ron's Excel Tips page. See link when on the above page. Gord Dibben MS Excel MVP On 3 Feb 2007 20:05:13 -0800, "tnederlof" wrote: Hey right now I have a huge excel sheet with like 250 columns and there are about 250 rows but I need the macro to go up to 1500 because I will be getting more data. In the column "i" I have different strings such as "Burger King". I need a macro that will copy every row in the sheet that is the value of Burger King in "i" for example to its own sheet entitled that value. Can someone help me out please? I tried a few things I found by searching but they didn't work. Thank you very much! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Feb 3, 11:17 pm, Gord Dibben <gorddibbATshawDOTca wrote:
DataFilterAutofilter. Filter for Burger King on column I. Copy and paste the results to a Burger King sheet. If you need code for copying, adding a sheet and pasting try Ron de Bruin's site for methods. http://www.rondebruin.nl/copy5.htm More on Copying, Pasting and Merging at Ron's Excel Tips page. See link when on the above page. Hmm I tried those and they would only copy the first row and that is it. Gord Dibben MS Excel MVP On 3 Feb 2007 20:05:13 -0800, "tnederlof" wrote: Hey right now I have a huge excel sheet with like 250 columns and there are about 250 rows but I need the macro to go up to 1500 because I will be getting more data. In the column "i" I have different strings such as "Burger King". I need a macro that will copy every row in the sheet that is the value of Burger King in "i" for example to its own sheet entitled that value. Can someone help me out please? I tried a few things I found by searching but they didn't work. Thank you very much! |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
It use this now If there is a empty row it not filter all data when you use the AutoFilter example Set rng = WS.Range("A1").CurrentRegion '<<< Change You can change it to Set rng = WS.Range("A1:IV5000") -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "tnederlof" wrote in message ups.com... On Feb 3, 11:17 pm, Gord Dibben <gorddibbATshawDOTca wrote: DataFilterAutofilter. Filter for Burger King on column I. Copy and paste the results to a Burger King sheet. If you need code for copying, adding a sheet and pasting try Ron de Bruin's site for methods. http://www.rondebruin.nl/copy5.htm More on Copying, Pasting and Merging at Ron's Excel Tips page. See link when on the above page. Hmm I tried those and they would only copy the first row and that is it. Gord Dibben MS Excel MVP On 3 Feb 2007 20:05:13 -0800, "tnederlof" wrote: Hey right now I have a huge excel sheet with like 250 columns and there are about 250 rows but I need the macro to go up to 1500 because I will be getting more data. In the column "i" I have different strings such as "Burger King". I need a macro that will copy every row in the sheet that is the value of Burger King in "i" for example to its own sheet entitled that value. Can someone help me out please? I tried a few things I found by searching but they didn't work. Thank you very much! |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I just says subscript out of range. Could someone post the script modifed for burger king on a page called "rawdata" and so that the value is found in column i? Thanks On Feb 4, 5:34 am, "Ron de Bruin" wrote: Hi It use this now If there is a empty row it not filter all data when you use the AutoFilter example Set rng = WS.Range("A1").CurrentRegion '<<< Change You can change it to Set rng = WS.Range("A1:IV5000") -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "tnederlof" wrote in oglegroups.com... On Feb 3, 11:17 pm, Gord Dibben <gorddibbATshawDOTca wrote: DataFilterAutofilter. Filter for Burger King on column I. Copy and paste the results to a Burger King sheet. If you need code for copying, adding a sheet and pasting try Ron de Bruin's site for methods. http://www.rondebruin.nl/copy5.htm More on Copying, Pasting and Merging at Ron's Excel Tips page. See link when on the above page. Hmm I tried those and they would only copy the first row and that is it. Gord Dibben MS Excel MVP On 3 Feb 2007 20:05:13 -0800, "tnederlof" wrote: Hey right now I have a huge excel sheet with like 250 columns and there are about 250 rows but I need the macro to go up to 1500 because I will be getting more data. In the column "i" I have different strings such as "Burger King". I need a macro that will copy every row in the sheet that is the value of Burger King in "i" for example to its own sheet entitled that value. Can someone help me out please? I tried a few things I found by searching but they didn't work. Thank you very much! |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this
Sub Copy_With_AutoFilter1() Dim WS As Worksheet Dim WSNew As Worksheet Dim rng As Range Dim rng2 As Range Dim Str As String Set WS = Sheets("rawdata") '<<< Change 'A1 is the top left cell of your filter range and the header of the first column Set rng = WS.Range("A1:IV5000") Str = "Burger King" '<<< Change 'Close AutoFilter first WS.AutoFilterMode = False 'This example filter on the first column in the range (change the field if needed) 'I change the 1 to the I column = 9 rng.AutoFilter Field:=9, Criteria1:=Str Set WSNew = Worksheets.Add WS.AutoFilter.Range.Copy With WSNew.Range("A1") ' Paste:=8 will copy the columnwidth in Excel 2000 and higher .PasteSpecial Paste:=8 .PasteSpecial xlPasteValues .PasteSpecial xlPasteFormats Application.CutCopyMode = False .Select End With ' 'If you want to delete the rows in WS that you copy use this also ' With WS.AutoFilter.Range ' On Error Resume Next ' Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count) _ ' .SpecialCells(xlCellTypeVisible) ' On Error GoTo 0 ' If Not rng2 Is Nothing Then rng2.EntireRow.Delete ' End With WS.AutoFilterMode = False On Error Resume Next WSNew.Name = Str If Err.Number 0 Then MsgBox "Change the name of : " & WSNew.Name & " manually" Err.Clear End If On Error GoTo 0 End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "tnederlof" wrote in message oups.com... I just says subscript out of range. Could someone post the script modifed for burger king on a page called "rawdata" and so that the value is found in column i? Thanks On Feb 4, 5:34 am, "Ron de Bruin" wrote: Hi It use this now If there is a empty row it not filter all data when you use the AutoFilter example Set rng = WS.Range("A1").CurrentRegion '<<< Change You can change it to Set rng = WS.Range("A1:IV5000") -- Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm "tnederlof" wrote in oglegroups.com... On Feb 3, 11:17 pm, Gord Dibben <gorddibbATshawDOTca wrote: DataFilterAutofilter. Filter for Burger King on column I. Copy and paste the results to a Burger King sheet. If you need code for copying, adding a sheet and pasting try Ron de Bruin's site for methods. http://www.rondebruin.nl/copy5.htm More on Copying, Pasting and Merging at Ron's Excel Tips page. See link when on the above page. Hmm I tried those and they would only copy the first row and that is it. Gord Dibben MS Excel MVP On 3 Feb 2007 20:05:13 -0800, "tnederlof" wrote: Hey right now I have a huge excel sheet with like 250 columns and there are about 250 rows but I need the macro to go up to 1500 because I will be getting more data. In the column "i" I have different strings such as "Burger King". I need a macro that will copy every row in the sheet that is the value of Burger King in "i" for example to its own sheet entitled that value. Can someone help me out please? I tried a few things I found by searching but they didn't work. Thank you very much! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
COUNTIF in between rows | Excel Worksheet Functions | |||
copy from B worksheet to A worksheet with NO repeated data | Excel Discussion (Misc queries) | |||
copy non-consecutive rows | Excel Discussion (Misc queries) | |||
Copy worksheet & maintain cell reference across worksheets | Excel Worksheet Functions | |||
Search a worksheet, extract rows using a list from another sheet | Excel Discussion (Misc queries) |