I am copying and pasting data from one worksheet to another and I would like to add an IF qualifying statement to the loop
If cell = FALSE paste, else skip. that is what i am after.
Thank you in advance for guidance and help.
If cell = FALSE paste, else skip. that is what i am after.
VBA Code:
j = 2 ' Reset j back to 2.
' Sets starting point for copy/paste of data to correct Cell.
Set rFoundCell = Worksheets("overview").Range("A1")
' Starts for loop to search for 'start' vaule on the Overview Worksheet in the Protector Type column.
For lCount = 1 To Application.WorksheetFunction.CountIf(Worksheets("overview").Range("a1:a200"), start)
' Finds the 'start' value on the Overview Worksheet in the Protector Type column.
Set rFoundCell = Worksheets("overview").Columns(1).Find(what:=start, after:=rFoundCell, LookIn:=xlValues, lookat:=xlPart, searchorder:=xlByRows, searchdirection:=xlNext, MatchCase:=False)
' Start of the copy/paste data from Overview to new Group # Worksheet in a transpose form.
With rFoundCell
' The offset will move the source from column A to column E, column count -1 = number below. A = 0, B = 1, C = 2, etc...
Worksheets("overview").Range(rFoundCell.Address).Offset(, 4).Copy
Worksheets("group " & start).Activate
' .Cells([row], [column]). .Cells(32, j) moves down to Row 32.
Worksheets("group " & start).Cells(32, j).PasteSpecial xlPasteValues
j = j + 1
End With
Next lCount
Thank you in advance for guidance and help.