Klartigue
06-06-2012, 11:32 AM
I know that this expression means if the cell is blank:
Sub Mellon()
' Copy and paste Mellon allocations into new sheet in workbook
Dim lastrow As Long
Dim i As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, "X").End(xlUp).Row
For i = 4 To lastrow
If .Cells(i, "X").Value = "" Then
With Range(.Cells(i, "A"), .Cells(i, "X")).Select
Selection.Cut
Sheets("Mellon").Select
Range("A10000").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Blotter").Select
End With
End If
Next i
End With
End Sub
How do I write the code to say if there is text in cells in column X then copy and paste those lines into a new sheet?
Sub Mellon()
' Copy and paste Mellon allocations into new sheet in workbook
Dim lastrow As Long
Dim i As Long
With ActiveSheet
lastrow = .Cells(.Rows.Count, "X").End(xlUp).Row
For i = 4 To lastrow
If .Cells(i, "X").Value = "" Then
With Range(.Cells(i, "A"), .Cells(i, "X")).Select
Selection.Cut
Sheets("Mellon").Select
Range("A10000").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Blotter").Select
End With
End If
Next i
End With
End Sub
How do I write the code to say if there is text in cells in column X then copy and paste those lines into a new sheet?