Paste data from One Sheet to Another

mar1618

New Member
Joined
May 8, 2013
Messages
1
Hi All:

I'm trying to copy data from one sheet to another. The following code is working but the problem is that it only copies the first line and it does not select any other breached or warning ticket(see attachment) If you open the sheet the code won't work because I set the Range to "D7:AC7" (See the commented lines below):

Code:
Option Explicit
Private Sub Worksheet_Activate()
Dim LR As Long

Me.UsedRange.Offset(17).ClearContents

With Sheets("Raw - Incident Request Report")
      .AutoFilterMode = False
      .Range("D7:AC7").AutoFilter 29, Criteria1:="Breached", Criteria2:="Warning" 'This is the part that is not working properly if I change this to "D7:AF7" it works but it only grabs the first Breached ticket
      LR = .Range("D" & .Rows.Count).End(xlUp).Row
      If LR > 1 Then
          .Range("AC7:AC" & LR).Copy Range("C17") 'In here I need to make this so that it only copies the information not the formatting
          .Range("D7:D" & LR).Copy Range("D17")
          .Range("I7:I" & LR).Copy Range("E17")
          .Range("K7:K" & LR).Copy Range("F17")
          .Range("T7:T" & LR).Copy Range("G17")
      Else
           Range("C17") = "No Data Found"
      End If
      .AutoFilterMode = False
End With
End Sub

Can anyone help solve this issue, please?

Here is the link to the file https://dl.dropboxusercontent.com/u/55305970/Report.xlsm
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,215,826
Messages
6,127,116
Members
449,359
Latest member
michael2

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