Data Copying

mariasrg

New Member
Joined
Jul 2, 2018
Messages
14
Hi

I have a spreadsheet that has multiple tabs - each tab has the same column headers. 2 columns show Risk and Priority where the values can be low, medium or high. If the value of these is High I would like to copy the whole row of data to a summary worksheet within the same spreadsheet - if that makes sense.

Thanks in advance
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What are the column letters for the two columns? Do both have to show "High" in order for the row to be copied? Do you want to do this on every worksheet?
 
Upvote 0
What are the column letters for the two columns? Do both have to show "High" in order for the row to be copied? Do you want to do this on every worksheet?

Hi - E and F on each work sheet so will need to copy from every one - would need to be either E or F has "High"

Date of EntryObjective Due Date Outstanding Tasks Level of Priority Risk Responsibilty
09/03/2020​
Consistent working
15/09/2020​
Medium Low Rob
09/03/2020​
16/09/2020​
 
Upvote 0
Place this macro in the code module for ThisWorkbook. Do the following: Hold down the ALT key and press the F11 key. This will open the Visual Basic Editor. In the left hand pane, double click on "ThisWorkbook". Copy/paste the macro into the empty window that opens up. Close the window to return to your sheet. The macro assumes you have a sheet named "Summary". Make an entry in column E or F and press the RETURN key. Please note that columns E and F must be the last columns populated. So fill in columns A to D and G first and then column E or F.

VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    If Intersect(Target, Range("E:F")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    If Sh.Name <> "Summary" Then
        If Target = "High" Then
            Target.EntireRow.Copy Sheets("Summary").Cells(Sheets("Summary").Rows.Count, "A").End(xlUp).Offset(1)
        End If
    End If
    Application.EnableEvents = True
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
I tried on a dummy workbook and it worked properly. Did you place the macro in the code module for ThisWorkbook?
 
Upvote 0
Hi Yes - followed your instructions - tried in a dummy one to - still not working - Im so sorry - Im probably doing something wrong.
 
Upvote 0
Click here to download your sample file. I have added data validation in columns E and F. Just click and make a selection.
 
Upvote 0
Does the screen shot of the data in Post #3 show your actual data or is it just a sample? If a sample, please post a screen shot of your actual data, de-sensitized if necessary.
 
Upvote 0

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top