Free Microsoft Excel 2013
Quick Reference
Free Microsoft 2013 Quick Reference Guide

Free Microsoft Excel 2013 Quick Reference

VB Code to search,copy,paste and stop at blank row!

Hi,

I have a worksheet of data.
I would like some code that will search down column F for 'RBK' when found copy cells C:J of the next row, paste this into next avaiable row in column Z. Then copy next rows cells C:J and paste again into next available row in row Z - keep doing this until there is a blank cell in column F

..Hope this makes sense and thanks in advance for your help


Post your answer or comment

comments powered by Disqus
Greetings to all,

I am new to this forum and very new to VBA. I typically copy/paste/modify VBA's to suit my needs but I haven't been able to piece together any codes that'll obtain my overall objective. Aaron Blood's code for search/copy/paste was a great read and I'm sure I'll use it in some future project, but I wasn't able to modify it using it with a listbox. The help I need is on using a multiselect listbox (attached to a sheet and not a userform) to search multiple worksheets and copy/paste the search results to a new sheet w/ a code to name the sheet (I'm sure I can find a code for that here on this forum, just haven't looked yet). I would also like to have the code to search based on a date range if possible. This code will be linked to a macro that will ultimately generate a report of the results to a word template using mail merge (still working on that code, haven't figured that out yet either). After the code is ran, I would like for the listboxes to be cleared. Anytime the macro is used, the last search results (worksheet data) needs to be deleted.

I attached a copy of the workbook for anyone interested in looking at it and willing to help. Thanks for any advice or assistance you can provide.

Weekly Brief Jul2011+ - Sample.xlsm

Hi All,

I am new to VBA and this forum, but have already learned a lot since joining!

I think there are a few ways to do what i'm trying to do and my first way may not be working. I want to copy/paste between different sheets based on a value in the row. For example, if I have these rows:

Company New/Exist Communication Status
Business1 New No contact
Business2 New No contact
Business3 New No contact

And then I update the communication status (which will happen for multiple rows), then I want to move it to a different sheet. The columns do not exactly align, so I'd paste each column at a time. There are also two other sheets, for "Contacted" and "Negotiating", so I want to move them into the appropriate sheet based on the Communciation status.

The code I have so far is as follows:


	VB:
	
 
Sub UpdateProspects_2() 
     
    Application.ScreenUpdating = False 
    Application.DisplayAlerts = False 
    Application.StatusBar = "Working..." 
     
    Dim SetWbkName As String 
     
    Dim LRowProspects As Long 
    Dim LRowContacted As Long 
    Dim HRow As Long 
    On Error Resume Next 
     
    SetWbkName = ThisWorkbook.Name 
     
    Sheets("Prospects").Select 
    LRowProspects = Range("A1048576").End(xlUp).Row 
    HRow = Range("A8").Row 
     
    Sheets("Contacted").Select 
    LRowContacted = Range("A1048576").End(xlUp).Row 
     
    Sheets("Prospects").Select 
    Range("A8").Select 
    Range(Selection, Selection.End(xlToRight)).Select 
     
    If Not ActiveSheet.AutoFilterMode Then 
        Selection.AutoFilter 
    End If 
     
     '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    ActiveSheet.Range(Cells(8, 1), Cells(LRowProspects, 13)).AutoFilter Field:=4, Criteria1:= _ 
    "2 - Interested" 
     
    Range(Cells(HRow + 1, 1), Cells(LRowProspects, 3)).Copy Destination:=Sheets("Contacted").Cells(LRowContacted,
"A").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 4), Cells(LRowProspects, 8)).Copy Destination:=Sheets("Contacted").Cells(LRowContacted,
"E").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 9), Cells(LRowProspects, 10)).Copy Destination:=Sheets("Contacted").Cells(LRowContacted,
"K").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 11), Cells(LRowProspects, 13)).Copy Destination:=Sheets("Contacted").Cells(LRowContacted,
"P").Offset(1, 0) 
     
    Sheets("Contacted").Select 
    LRowContacted = Range("A1048576").End(xlUp).Row 
     
    Range(Cells(7, 1), Cells(7, 45)).Copy 
    Range(Cells(7, 1), Cells(LRowContacted, 45)).PasteSpecial Paste:=xlFormats 
     
     'Delete raw data to save space
    Sheets("Prospects").Select 
     
    With Range(Cells(HRow + 1, 1), Cells(LRowProspects, 13)) 
        .Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete 
    End With 
     
     '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ActiveSheet.ShowAllData 
     
    Application.StatusBar = False 
     
End Sub 
 
 
Sub UpdateProspects_3() 
     
    Application.ScreenUpdating = False 
    Application.DisplayAlerts = False 
    Application.StatusBar = "Working..." 
     
    Dim SetWbkName As String 
     
    Dim LRowProspects As Long 
    Dim LRowNegotiating As Long 
    Dim HRow As Long 
    On Error Resume Next 
     
    SetWbkName = ThisWorkbook.Name 
     
    Sheets("Prospects").Select 
    LRowProspects = Range("A1048576").End(xlUp).Row 
    HRow = Range("A8").Row 
     
    Sheets("Negotiating").Select 
    LRowNegotiating = Range("A1048576").End(xlUp).Row 
     
    Sheets("Prospects").Select 
    Range("A8").Select 
    Range(Selection, Selection.End(xlToRight)).Select 
     
    If Not ActiveSheet.AutoFilterMode Then 
        Selection.AutoFilter 
    End If 
     
     '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    ActiveSheet.Range(Cells(8, 1), Cells(LRowProspects, 13)).AutoFilter Field:=4, Criteria1:= _ 
    "3 - Negotiating Deal" 
     
    Range(Cells(HRow + 1, 1), Cells(LRowProspects, 3)).Copy Destination:=Sheets("Negotiating").Cells(LRowNegotiating,
"A").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 4), Cells(LRowProspects, 4)).Copy Destination:=Sheets("Negotiating").Cells(LRowNegotiating,
"E").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 5), Cells(LRowProspects, 8)).Copy Destination:=Sheets("Negotiating").Cells(LRowNegotiating,
"X").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 9), Cells(LRowProspects, 10)).Copy Destination:=Sheets("Negotiating").Cells(LRowNegotiating,
"R").Offset(1, 0) 
     
    Range(Cells(HRow + 1, 11), Cells(LRowProspects, 13)).Copy Destination:=Sheets("Negotiating").Cells(LRowNegotiating,
"AB").Offset(1, 0) 
     
     
    Sheets("Negotiating").Select 
    LRowNegotiating = Range("A1048576").End(xlUp).Row 
     
    Range(Cells(52, 1), Cells(52, 45)).Copy 
    Range(Cells(52, 1), Cells(LRowNegotiating, 45)).PasteSpecial Paste:=xlFormats 
     
     'Delete raw data to save space
    Sheets("Prospects").Select 
     
    With Range(Cells(HRow + 1, 1), Cells(LRowProspects, 13)) 
        .Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete 
    End With 
     
     
    ActiveSheet.ShowAllData 
     
    Application.StatusBar = False 
     
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
My first attempt was to filter the data, copy the visible range, then paste in new tab. However, it works the first time, but usually not the second time. I dont know if its just the volatility associated with this method, in which case, maybe I'd have to sort/copy/paste?

Any help would be greatly appreciated!

I 'm trying to create a macro which can do the following, but im not having much luck:

Search column J in worksheet1, if it finds "x" then in the same row copy the text in teh corresponding columns C, D, E, & M.

Copy this data in the same order in the next empty row within worksheet2, with data from column C of worksheet1 pasted into column A of worksheet2, and so on. D=B, E=C, and M=D

Repeat the search, copy,paste until all non empty rows in worksheet1 have been searched.

Anyone know how to do that?

Many thanks
Joel

Hi,
In column A, I've got a list of numbers and I want to get to the last number.
The code steps down the list ok but I want the code to stop when it gets to the first blank cell in the list......it doesn't, it goes on forever !

How can I get it to stop ?

Sub Movedown()

Range("A1").Select
Dim Rnge As Range
Set Rnge = Range("a1")
While Rnge.Value ""
ActiveCell.Offset(1, 0).Activate

Wend

End Sub

Thanks
Steve

Hi all

I need to creat a macro to Search,Copy,Paste and delete the source rows array

I have attached my file for easy ref. I want to copy all the repeated yellow areas and paste it Special/Transpose in the blue areas

My orginal sheet has more than 400 areas need to be copied

at the end, after copy paste done I want to delete the source cells

I used the following macro but I dont know how to let the macro look into the sheet for the areas automatic


	VB:
	
Range("H117:P123").Select 
Selection.Copy 
Range("A125").Select 
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ 
False, Transpose:=True 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines

Thanks in advance

Subject Assessment Summary Data (1).xls

We need to export a check history report from Quickbooks Enterprise into Excel 2003 and Excel 2007 (XP OS). The number of pages to each report will vary in length depending on how many checks were run during a given month and how many rows it takes to list the details of the checks.

The report inserts blank rows between the checks, which we need to be able to delete in order to condense it to a minimal number of pages.

I have no experience with macros, however I catch on quickly and have done so in Adobe Acrobat with java scripting.

I would like to know if you can provide for me a macro that will find the page range of the report and then find and delete all blank rows within the report.

I know I will need to work with VB and I copied one macro that I saw on this forum into VB but the specific macro did not work properly for me in my test. However, I am using Excel 2010, which may make a difference as to how the macro is set up.

If Excel 2003 and/or 2007 work similarly to 2010, I believe I understand how to set up the macro using VB and where to save it so it is accessible for any workbook created in Excel, but I need the proper wording to enter so I can test it out.

Thank you in advance for any help you can give me. I hope I don't sound too ignorant on this!

Hello,

I have a data file that ID #'s and their associated reponses to various questions asked. In addition to their coded responses to multiple choice questions, they are also given the option to provide additional comments, however that is not required. Therefore some people write comments, and otehrs do not. I am trying to write a macro that would locate those respondents who wrote a comment (in column M) and then paste their comment and the related project # (in column B) and paste that onto the sheet for which the comments are for (identified in column F).

I'm not sure if this is even something that can be done, or if this is too complex, so any feedback and assistance would be greatly appreciated! Thanks so much in anvance! Below are some of the specifics that I tried to write out.

Select Sheet Raw Data

Search for the first active cell in column M

Within that row containing the active cell in column M:
Copy and Paste the following cells onto a new sheet in the first blank row on Sheet based on value in column F (detailed below)

If value in column F equals "Design Services" then copied selections (listed below) are copied into sheet name "Design Services"

If value in column F equals "Panel" then copied selections (listed below) are copied into sheet name "Panel"

If value in column F equals "Telephone" then copied selections (listed below) are copied into sheet name "Telephone"

If value in column F equals "Interactive" then copied selections (listed below) are copied into sheet name "Interactive"

If value in column F equals "Mail" then copied selections (listed below) are copied into sheet name "Mail"

If value in column F equals "MCP" then copied selections (listed below) are copied into sheet name "MCP"

If value in column F equals "Field Services" then copied selections (listed below) are copied into sheet name "Field Services"

If value in column F equals "CATI" then copied selections (listed below) are copied into sheet name "CATI"

If value in column F equals "Coding" then copied selections (listed below) are copied into sheet name "Coding"

If value in column F equals "DP" then copied selections (listed below) are copied into sheet name "DP"

If value in column F equals "AA&D" then copied selections (listed below) are copied into sheet name "AA&D"

If value in column F equals "Research Excellence" then copied selections (listed below) are copied into sheet name "Research Excellence"

-Value in column B (from sheet Raw Data) gets pasted into column A on the first blank row (paste into sheet specified above)
-Value in column F (from sheet Raw Data) gets pasted into column C on the first blank row (paste into sheet specified above)
-Value in column M (from sheet Raw Data) gets pasted into column B on the first blank row (paste into sheet specified above)

I would then like the macro to continue cycling through column M until it gets to the last active cell.

Hello,

I have built a user form.
The user inputs the part number and other data into the form (Parts Data Entry WS).
The data is then copied onto a separate worksheet (Physical Count WS).
The VB code should then search by part number on the (MIP) WS and find the part description and Std Cost.
That Data then copies in the appropriate columns.

The code should then autofill or all of the rows that have part numbers.


	VB:
	
 
 
 
Private Sub cmdAdd_Click() 
    Dim iRow As Long 
    Dim ws As Worksheet 
    Set ws = Worksheets("Physical Count") 
     
     
     
     
    iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _ 
    SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1 
     
     
     
     
    If Trim(Me.txtPart.Value) = "" Then 
        Me.txtPart.SetFocus 
        MsgBox "Please enter a part number" 
        Exit Sub 
    End If 
     
     
    ws.Cells(iRow, 1).Value = Me.txtPart.Value 
    ws.Cells(iRow, 2).Value = Me.txtqty.Value 
    ws.Cells(iRow, 3).Value = Me.txttip.Value 
    ws.Cells(iRow, 4).Value = Me.cmbStatus.Value 
     
     
    Me.txtPart.Value = "" 
    Me.txtqty.Value = "" 
    Me.txttip.Value = "" 
    Me.cmbStatus.Value = "" 
    Me.txtPart.SetFocus 
     
     
End Sub 
 
 
Private Sub cmdClose_Click() 
    Unload Me 
End Sub 
 
 
Private Sub txtQty_Change() 
     
     
End Sub 
 
 
Private Sub UserForm_QueryClose(Cancel As Integer, _ 
    CloseMode As Integer) 
    If CloseMode = vbFormControlMenu Then 
        Cancel = True 
        MsgBox "Please use the button!" 
    End If 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines

Thanks

I've got a database with a ID--such as TC38493--in column A, but not in every row. Instead its the ID followed by more information about that ID. And the information is contained in more then one cells in the rows below it. Unfortunately the number of rows of information is not a regular amount, sometimes its 2 sometimes is 7 rows.

TC389214
Information Information Information
Information Information Information
Information Information Information
TC298315
Information Information Information
Information Information Information
Information Information Information
Information Information Information
Information Information Information
TC073847
Information Information Information
Information Information Information

Then in my second document I've got a lot of these IDs listed. I need to search Document1 with the ID from Document2 and when it finds anything it will paste all of the information--whether its 2 rows or 7--back in document2.
Anyone want to write me a program, or at least start me off? I know the very basics of VBA. If you'd like more information just ask.

Can someone please help tell me what is the correct syntax/ie vb code
to copy a entire row from one sheet to another?

Pretend I have two sheets and want to copy an entire row from sheet2
to sheet one , what is the code to do something like this?

I know I can do it manually, but for what I am doing I need
the macro code to do it automatically.

Thanks

--
bxc2739
------------------------------------------------------------------------
bxc2739's Profile: http://www.excelforum.com/member.php...o&userid=32538
View this thread: http://www.excelforum.com/showthread...hreadid=545604

I am wondering how to write the code to search for tab (sheets) in a workbook that contains certain name.

I have 400 different sheets in 1 workbook and I am writing a macro to compiled them into 1 sheet. I got the copy paste macro done, but I am stuck with searching only to specific sheet that contain that particular name.

Any help would be appreciated. Thank you in advance.

I am looking for a VB code to copy data from columns A and B to Cells C and D. I need the Data to fill top to bottom in C and D with no skipped rows or filling in extra data.

There may be skipped rows in A an B with no data and A and B are filled with a formula. Can this be done automatically ? Thanks

Hello friends,

I am trying to disable cut copy paste and force enable macros in my worksheet, I have the following code that disables cut copy paste but I need help to force enable macros. I did search the forum and found a few codes but I always end up getting errors. The following is my cut copy past code.

Option Explicit

Sub EnableControl(Id As Integer, Enabled As Boolean)
Dim CB As CommandBar
Dim C As CommandBarControl
For Each CB In Application.CommandBars
Set C = CB.FindControl(Id:=Id, recursive:=True)
If Not C Is Nothing Then C.Enabled = Enabled
Next
End Sub

Private Sub Workbook_Activate()

EnableControl 21, False ' cut
EnableControl 19, False ' copy
EnableControl 22, False ' paste
EnableControl 755, False ' pastespecial
Application.OnKey "^x", ""
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "+{DEL}", ""
Application.OnKey "+{INSERT}", ""
Application.CellDragAndDrop = False
Application.CutCopyMode = False
Application.CommandBars("Standard").Controls("Paste").Enabled = False

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
EnableControl 21, True ' cut
EnableControl 19, True ' copy
EnableControl 22, True ' paste
EnableControl 755, True ' pastespecial
Application.OnKey "^x"
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
Application.CellDragAndDrop = True
Application.CutCopyMode = True
Application.CommandBars("Standard").Controls("Paste").Enabled = True

End Sub

Private Sub Workbook_Deactivate()
EnableControl 21, True ' cut
EnableControl 19, True ' copy
EnableControl 22, True ' paste
EnableControl 755, True ' pastespecial
Application.OnKey "^x"
Application.OnKey "^c"
Application.OnKey "^v"
Application.OnKey "+{DEL}"
Application.OnKey "+{INSERT}"
Application.CellDragAndDrop = True
Application.CutCopyMode = True
Application.CommandBars("Standard").Controls("Paste").Enabled = True

End Sub

Private Sub Workbook_Open()
EnableControl 21, False ' cut
EnableControl 19, False ' copy
EnableControl 22, False ' paste
EnableControl 755, False ' pastespecial
Application.OnKey "^x", ""
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "+{DEL}", ""
Application.OnKey "+{INSERT}", ""
Application.CellDragAndDrop = False
Application.CutCopyMode = False
Application.CommandBars("Standard").Controls("Paste").Enabled = False

End Sub


Thank you

Can someone please help tell me what is the correct syntax/ie vb code
to copy a entire row from one sheet to another?

Pretend I have two sheets and want to copy an entire row from sheet2
to sheet one , what is the code to do something like this?

I know I can do it manually, but for what I am doing I need
the macro code to do it automatically.

Thanks

Is there a way i can use a marco to search all the data in "raw" sheet and then copy and paste data dependant on plant names in cell D3:D10 from the "...Zone" tab from the "raw" tab to the next emtpy row of the"....Zone" tab

Hi,

I am looking for a macro to search all cells and find product?categoryID= and after the = sign to copy the 15 numbers and paste those numbers to another workbook called categorycopy on column a. Then the row underneath it will have target="_self">Card Reader</a></li> I need the data in between _self"> and </a></li> then copy it to workbook category to column b

I have attached an example spreadsheet on the data that needs to be searched & copied over.

thanks for your help

testcategories.xlsx

VBA code to search for and delete Form Controls on an Excel 2007 spreadsheet

Hi all,

Another query regarding searching of files. This topic in VBA is not easy, at least to my standards.

This time, I want to search a folder which contains hundreds of data files. I want to search for those files based on the Last modified date/time. I want to search those files and copy them to a different destination and open them to copy a particular range of cells to another new work sheet for processing.

For example: I want to search for those files that were last saved in a particular month/week.

The code i need is to search and copy files at destination folder based on date range that I specify and open them. I hope that I can manage with the rest of the code.
I would like to input the date range at a particular cell in my worksheet which the code can access to perform the search.

Thanks in advance.

Cheers
-Yogesh

Hello all,

I am new to this group. I am trying to write a VBA code to search and replace a string in a closed HTML file. Could some one in the group help me by giving code.

Many Thanks
Vish

Hi guys,

Im stuck on trying to create a code to search through a worksheet
trying to match data in column G, then on A and D.

So in example I have 13000 rows of data.

Where for example some of the data looks like this :

Column A Column B Column G
123 456 6
123 456 6
345 567 8
322 567 8

By the data above, I would want the macro to highlight the row 1 and 2 as they have the same data in column G, then in A and B. Row 3 and 4 are incorrect, as they do not have matching data. But even if the data that was correct matching, was in row 1 and 34, I would want them to be put together and highlighted.

I assume a quick sort of columns before the macro kicks in would fix that?!

I really appreciate any help on this, as per now its a days work for something im sure can be done in a few mins.

Hi

I need some help with creating vb code that will select certain rows in a spreadsheet, set the print area to those rows and print them out, and then reset the print area back to default.
The data is all on one sheet, but is split into 5 different areas, each below the next, with the column headers at the top of each.
e.g.

header_____header_____header
data_______data_______data
data_______data_______data
data_______data_______data

header_____header_____header
data_______data_______data
data_______data_______data
data_______data_______data

and so on. At the press of a button it'll set the print area to the first section and print (the section includes the headers as well as the data). Then at the press of another button it'll set the print area to the next section. There could be any amount of rows of data in each section so it needs to cope with that.

Any help would be really appreciated.
thanks

I need some help writing some code to do the following.

Column "E" (cells E6 to E88) on the sheet "Current Activity" contains ref numbers. On a second sheet "Call Sheet" cell C8 is where I enter a ref number and I need the code to search the sheet "Current Activity" Column "E" (cells E6 to E88) for the number that i have entered.
Then copy the data that is located in column "G" to the "Call Sheet" starting at cell C17 and down to C36 as required.

******** ******************** ************************************************************************>Microsoft Excel - Lionys Current Activity (Test1).xls___Running: xl2002 XP : OS = Windows XP (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)boutJ6K6L6J7K7L7J8K8L8J9K9L9J10K10L10J11K11L11J12K12L12J13K13L13J14K14L14J15K15L15J16K16L16=
DEFGHIJKLMNO4Lionys*******Pick*up**5Ref*#DateCompanyUnitDriver***LocationCustomerDestination6L-11-JunLionys*Trucking*Ltd.ShelbyCurt*Whitten11-JunShelbyKuusomoEcho*Exploration*12-22-33-2W57L-11-JunLionys*Trucking*Ltd.AustinNew*Guy11-JunAustinKuusomoEcho*Exploration*12-22-33-2W58L-11-JunLionys*Trucking*Ltd.BrandonNew*Guy11-JunBrandonKuusomoEcho*Exploration*12-22-33-2W59L-21-JunJD&C*Services**21-Jun*
EssoDeadeye*Engineering*Inc.10-22-55-12W510L-31-JunMorton*Oilfield*Rentals**31-Jun*
EssoDeadeye*Engineering*Inc.10-22-55-12W511L-41-JunK*Longdo*Trucking**41-Jun*
KuusomoDesmarais*Energy*Corporation12-12-12-12W412L-41-JunK*Longdo*Trucking**41-Jun*
KuusomoDesmarais*Energy*Corporation12-12-12-12W413L-******
*
*
***14L-******
*
*
***15L-******
*
*
***16L-******
*
*
***Current Activity*
[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

Any help would be welcomed
Thanks in advance

Hi,

Does anyone have a code to prevent cut&paste for a range of cells. I am newish to excel and would greatly appreciate the procedure to do so!! I only need to disable the cut&paste function as I still need to be able to copy&paste.

many thanks

Col

Hello folks,

I am trying to figure out how to use a loop to generate multiple reports from one source spreadsheet. Below is an example of what I would like to do:

Master Spreadsheet:

School Network Attendance Rate
1 A 96
4 A 95
3 B 84
7 B 90
2 C 92
5 C 98
Data is sorted only for Network A, copied, pasted and saved onto a new workbook.

School Network Attendance Rate
1 A 96
4 A 95
What I've been doing is recording a macro for all the steps to save the data for one network, copying the VBA code and pasting it over and over again for the other networks. I want to know if there is loop that can do this for me.


No luck finding an answer? You could always try Google.