Hello
I'm trying to set up a macro to copy data from columns B and C in rows 2:200 of worksheet A where specific criteria in column S of that worksheet is met. The data would copy to columns A and B of worksheet B, starting in row 5, having first cleared down any data in the first 20 rows from row 5 which may have been previously populated. The data to be copied as value only, i.e. not bringing across formats from the first worksheet.
My VBA knowledge is basic, to say the least, but I usually manage to work it out by searching forums such as this, finding answers to similar questions and modifying the code, but this one has me stumped.
This is what I've got so far. Many thanks in advance for advice/assistance!
Code
Sub CopyYes()
Dim c As Range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
Set Source = ActiveWorkbook.Worksheets("Payment Schedule")
Set Target = ActiveWorkbook.Worksheets("Funding Template Prep")
'clear contents from target worksheet doesn't work
wsTarget.Range("A5:C25").ClearContents
j = 5
For Each c In Source.Range("s2:s200")
If c = "Yes" Then
'code to copy data in columns b and c from source worksheet, (starting at row 2),
'to columns a and b on target worksheet, (starting at row 5)
'paste special, i.e. values only - don't bring across formats
j = j + 1
End If
Next c
End Sub
Display More