I modified a previous code that was looking at numbers versus letters. But what I'm trying to do is look in column 4 and if the first 3 letters begin with CDR or CAP copy to sheet2. I am unsure what i am missing. thanks in advance
I suspect this is the portion that is creating a problem but have not been able to figure it out. Thanks
Code
Sub SORT_SURFACE_BILLETS()
Dim x, i As Long, ii As Long
Dim iCDRCAP As Integer
x = Sheets("SHEET1").Cells(1).CurrentRegion.Resize(, 14)
ReDim DataCDRCAP(1 To UBound(x, 1), 1 To 14)
For i = 2 To UBound(x, 1)
Select Case Left(x(i, 4), 3)
Case CDR, CAP
iCDRCAP = iCDRCAP + 1
For ii = 1 To 14
DataCDRCAP(iCDRCAP, ii) = x(i, ii)
Next
End Select
Next
Application.ScreenUpdating = 0
With Sheets("SHEET2").Cells(1).CurrentRegion
.Offset(1).Resize(.Rows.Count, 14).ClearContents
.Parent.[a2].Resize(UBound(DataCDRCAP, 1), 14) = DataCDRCAP
End With
End Sub
Display More