I have a functioning set of code to copy data from one worksheet to another in a nested format to both figure out how many data sets to copy as well as transpose to the other end.
I am wanting to add some qualifying code that checks the value of the cell to be copied before it is moved. If it contains the boolean FALSE statement copy said data, else iterate the loops and continue to the next cell.
The working code is as follows:
In the With loop is were I would like to add the IF ELSE code to check if the cell contains FALSE.
Code currently does the following:
Input:
output:
desired output:
Thank you in advance
I am wanting to add some qualifying code that checks the value of the cell to be copied before it is moved. If it contains the boolean FALSE statement copy said data, else iterate the loops and continue to the next cell.
The working code is as follows:
VBA Code:
' ================================================================
' Code to copy cells from Overview sheet to new group Worksheet.
' ================================================================
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 cells column.
For lCount = 1 To Application.WorksheetFunction.CountIf(Worksheets("overview").Range("a1:a200"), start)
' Finds the 'start' value on the Overview Worksheet in the cells 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 AE, column count -1 = number below. A = 0, B = 1, C = 2, etc...
Worksheets("overview").Range(rFoundCell.Address).Offset(, 30).Copy
Worksheets("group " & start).Activate
' .Cells([row], [column]). .Cells(34, j) moves down to Row 52.
Worksheets("group " & start).Cells(34, j).PasteSpecial xlPasteValues
j = j + 1
End With
Next lCount ' End loop for copy cells.
In the With loop is were I would like to add the IF ELSE code to check if the cell contains FALSE.
Code currently does the following:
Input:
TRUE |
FALSE |
FALSE |
FALSE |
TRUE | FALSE | FALSE | TRUE |
FALSE | FALSE |
Thank you in advance