RyanTG
New Member
- Joined
- Nov 29, 2015
- Messages
- 42
Hi everyone
Spent hours trying to figure out why this loop stops early (Row 48,577).
I tried many solutions from the forum with no success.
Here is the simple table I am using to copy/paste data:
There is nothing different about the data when it stops, so that is not causing it. The table I am using has around 270,000 rows.
Below is the code I am using to parse the data:
I get error: Run Time 1004
1. Excel 2010; Windows 7 Pro
2. PC
Spent hours trying to figure out why this loop stops early (Row 48,577).
I tried many solutions from the forum with no success.
Here is the simple table I am using to copy/paste data:
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
1 | gm_accountno | name | property_string | Account | Identifier | ||
2 | A6022438593%A_/?CityOntarioA6022438593%A_/? | ||||||
3 | A6022438593%A_/?Notes*** TODD (Todd Viani) *** November 19, 2015 at 2:17pmA6022438596(3U&X | ||||||
4 | A6022438593%A_/?StateCAA6022438596%PQ={ | ||||||
5 | A6022438593%A_/?A6022438598&/U$U | ||||||
6 | A6022438593%A_/?A6022438598$=9^M | ||||||
7 | A6022438596(3U&XA6022438598(%:7 | ||||||
SortDateHere |
There is nothing different about the data when it stops, so that is not causing it. The table I am using has around 270,000 rows.
Below is the code I am using to parse the data:
Code:
Sub ExtractIdentifier()
Dim x As Long
Dim MyTimer As Double
Dim booStatusBarState As Boolean
Dim iMax As Long
Dim i As Long
iMax = 264273
Application.ScreenUpdating = False
booStatusBarState = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Range("A2").Select
For i = 1 To iMax
fractionDone = CDbl(i) / CDbl(iMax)
Application.StatusBar = Format(fractionDone, "0%") & " done..."
'TWO LINES ABOVE ARE FOR THE STATUS BAR
'BELOW: To Copy Account #
If ActiveCell = ActiveCell.Offset(-1, 0).Range("Table4[[#Headers],[gm_accountno]]") Then
Else
ActiveCell.Offset(1000000, 3).End(xlUp).Offset(1, 0).Value = ActiveCell.Value
ActiveCell.Select
End If
'BELOW: To Copy Identifier
If ActiveCell.Offset(0, 1) = "Identifier" Then
ActiveCell.Offset(1000000, 3).End(xlUp).Offset(0, 1).Value = ActiveCell.Offset(0, 2).Value
ActiveCell.Select
End If
'NEXT LINE
ActiveCell.Offset(1, 0).Select
DoEvents
Next i
Application.DisplayStatusBar = booStatusBarState
''//Reset Status bar display setting
Application.StatusBar = False
''//Return control of the Status bar to Excel
Application.ScreenUpdating = True
''//Turn on screen updating
End Sub
I get error: Run Time 1004
1. Excel 2010; Windows 7 Pro
2. PC