KillerDragonKC
New Member
- Joined
- Sep 9, 2015
- Messages
- 20
I have the following code that i resulting in an error due to it is too complex and not a contiguous set of data.
I beleive it is due to there being too many rows for Excel to properly execute. I have scoured the forum to make something work in my favor, but have come up with incorrect solutions or improper implementations.
Under normal circumstances the worksheets aren't nearly as extensive as the one I am currently working on, although I have encountered this issue in the past and had to manually do the deletions then continue the script to complete the process.
The error falls on the -- .Columns("A").SpecialCells(xlCellTypeVisible).EntireRow.Delete -- line of the code.
Any assistance on this issue is greatly appreciated.
I beleive it is due to there being too many rows for Excel to properly execute. I have scoured the forum to make something work in my favor, but have come up with incorrect solutions or improper implementations.
Code:
With DataWS
.Range("B6:B" & LR).FormulaR1C1 = "=IF(ISNUMBER(SEARCH(""Co 90 Rg:"",RC[11])),RC[11]&RC[12],R[-1]C)"
.Range("E9:E" & LR).FormulaR1C1 = "=IF(AND(RC[8]=R9C13,RC[9]<>R4C14),MID(RC[9],9,5),R[-1]C)"
.Columns("B:E").Copy
.Columns("B:E").PasteSpecial Paste:=xlPasteValues
.Columns("B:B").TextToColumns Destination:=Range("B1"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 9), Array(10, 2), Array(13, 9), Array(19, 2), Array(21, 9), _
Array(25, 2), Array(28, 9)), TrailingMinusNumbers:=True
.Range("B9").FormulaR1C1 = "RGN"
.Range("C9").FormulaR1C1 = "DST"
.Range("D9").FormulaR1C1 = "CTR"
.Range("E9").FormulaR1C1 = "CREDIT PR"
.Range("F9:AA9").FormulaR1C1 = "=TRIM(R[-2]C&"" ""&R[-1]C)"
.Rows("9").Copy
.Rows("9").PasteSpecial Paste:=xlPasteValues
.Rows("1:8").Delete
.Rows("1:1").AutoFilter
.Range("$A$1:$AP$" & LR).AutoFilter Field:=24, Criteria1:=Array( _
"APPLIED", "AS O", "OTHER", "RUN DAT", "="), Operator:=xlFilterValues
.Rows("1").EntireRow.Hidden = True
.Columns("A").SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilterMode = False
.Rows("1").EntireRow.Hidden = False
End With
Under normal circumstances the worksheets aren't nearly as extensive as the one I am currently working on, although I have encountered this issue in the past and had to manually do the deletions then continue the script to complete the process.
The error falls on the -- .Columns("A").SpecialCells(xlCellTypeVisible).EntireRow.Delete -- line of the code.
Any assistance on this issue is greatly appreciated.