I have the following code which I am attempting to search range(A2: to end) for any cells that contain text (basically non blank) and if so the list the variable in column B in a list...
when I run this code it keep looping like crazy... can't quite put a handle on it!
Any advice would be awesome
thanks in advance,
when I run this code it keep looping like crazy... can't quite put a handle on it!
Code:
Private Sub CommandButton1_Click()
Dim mySheet As Worksheets
Set iSheet = Sheets("PLATFORM not in FRX")
x = iSheet.Rows.Count
ApplicationScreenUpdating = False
With iSheet.Range("A2:A" & x)
.Copy
.PasteSpecial (xlPasteValues)
End With
For iRow = x To 2 Step -1
If Application.IsText(iSheet.Cells(iRow, "A").Value) Then
z = Cells(iRow, 1).Value
theRow = iSheet.Cells(Rows.Count, "B").End(xlUp).Row + 1
iSheet.Cells(theRow, "B").Value = z
End If
Next iRow
ApplicationScreenUpdating = True
End Sub
Any advice would be awesome
thanks in advance,