A
angiec50
Hi
I am needing to be able to search through a column of data in Worksheet 1
and copy the matched and corresponding data to another worksheet starting at
row 4.
The code that I have already used is:
Sub cond_copy()
Sheets("Sheet1").Select
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To rowcount
Range("a" & i).Select
check_value = ActiveCell
If check_value = "True" Or check_value = "true" Then
ActiveCell.EntireRow.Copy
Sheets("Sheet2").Select
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
Range("a" & rowcount + 1).Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End If
Next
End Sub
This seems to work fine, apart from that it pastes the data and overwrites
my heading in Row 2 of Worksheet 2. Where and what do I need to write to
ensure that the copied data is placed in the correct position i.e. Row 4 on
Sheet 2
Thanks in advanced for your help
I am needing to be able to search through a column of data in Worksheet 1
and copy the matched and corresponding data to another worksheet starting at
row 4.
The code that I have already used is:
Sub cond_copy()
Sheets("Sheet1").Select
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
For i = 1 To rowcount
Range("a" & i).Select
check_value = ActiveCell
If check_value = "True" Or check_value = "true" Then
ActiveCell.EntireRow.Copy
Sheets("Sheet2").Select
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
Range("a" & rowcount + 1).Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End If
Next
End Sub
This seems to work fine, apart from that it pastes the data and overwrites
my heading in Row 2 of Worksheet 2. Where and what do I need to write to
ensure that the copied data is placed in the correct position i.e. Row 4 on
Sheet 2
Thanks in advanced for your help