I wish to copy a merged cell (3 cells) based on if only 1 of 3 cells to the right contain "X". if the top cell does not contain "X" than the merged cell is not copied. Also, is therea more elegant to copy 3 columns at a time rather than do one at a time as my code shows:
Sub CopyICUCAPU()
'
' CopyICUCAPU Macro
'
Dim i As Integer
For i = 5 To 29 Step 3
If Sheets("ICU").Range("L" & i).Value = "X" And Sheets("ICU").Range("A" & i).Value <> "" Then
Sheets("CAPU summary").Range("A" & i).End(xlUp).Offset(1).Value = Sheets("ICU").Range("A" & i).Value
End If
Next i
For i = 5 To 29 Step 3
If Sheets("ICU").Range("L" & i).Value = "X" And Sheets("ICU").Range("B" & i).Value <> "" Then
Sheets("CAPU summary").Range("B" & i).End(xlUp).Offset(1).Value = Sheets("ICU").Range("B" & i).Value
End If
Next i
For i = 5 To 29 Step 3
If Sheets("ICU").Range("L" & i).Value = "X" And Sheets("ICU").Range("c" & i).Value <> "" Then
Sheets("CAPU summary").Range("c" & i).End(xlUp).Offset(1).Value = Sheets("ICU").Range("c" & i).Value
End If
Next i
For i = 5 To 29
If Sheets("ICU").Range("L" & i).Value = "X" Then
Sheets("CAPU summary").Range("l" & i).Value = Sheets("ICU").Range("d" & i).Value
End If
Next i
End Sub
Bookmarks