Robjwalters
New Member
I have this code (which I did not write, but did modify to make it work on my sheet)and it works great now.
I want to know two things:
if instead of copying the entire row to a new sheet, can I adjust it to only copy Columns B,C,E,G.
I want it to clear the sheet before it copies in the new data.
I have tried to change it but no luck...
[
Option Explicit
Sub CopyRows()
Dim bottomL As Integer
bottomL = Sheets("Data").Range("C" & Rows.Count).End(xlUp).Row
Dim c As Range
For Each c In Sheets("Data").Range("C1:C" & bottomL)
If c.Value = "True" Then
c.EntireRow.Copy Worksheets("ToBeRemediated").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next c
End Sub
]
I want to know two things:
if instead of copying the entire row to a new sheet, can I adjust it to only copy Columns B,C,E,G.
I want it to clear the sheet before it copies in the new data.
I have tried to change it but no luck...
[
Option Explicit
Sub CopyRows()
Dim bottomL As Integer
bottomL = Sheets("Data").Range("C" & Rows.Count).End(xlUp).Row
Dim c As Range
For Each c In Sheets("Data").Range("C1:C" & bottomL)
If c.Value = "True" Then
c.EntireRow.Copy Worksheets("ToBeRemediated").Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
Next c
End Sub
]
Last edited: