T
tsorvillo
I am searching a column of data for a string of users input and am
receiving an error after searching 256 rows. Is there a limit on the
worksheet object? If not does anyone have any advice? I can not figure
out why it will not search past 256. Thank you.
Below is my code:
Set rngCasNumberRange = Range("A1:B13242")
intIfCounter = 1
'for loop to loop through column A and search for the first number
entered.
'fill Column D with the number and column E with the code if found
For rwIndex = 1 To 1
For colIndex = 2 To 13242
With Worksheets("SortedByCasNumberAndPhrase").Cells(rwIndex,
colIndex)
If rngCasNumberRange.Cells(colIndex, 1) = strCASNumberOne
Then
'fill variable with phase code corresponding to the cas
number found
strPhaseCodeOne = rngCasNumberRange.Cells(colIndex, 2)
'fill cells with found phrase code numbers
rngCasNumberRange.Cells((intIfCounter + 14), 4).Value =
strCASNumberOne
rngCasNumberRange.Cells((intIfCounter + 14), 5).Value =
strPhaseCodeOne
intIfCounter = intIfCounter + 1
End If
End With
Next colIndex
Next rwIndex
Thanks.
receiving an error after searching 256 rows. Is there a limit on the
worksheet object? If not does anyone have any advice? I can not figure
out why it will not search past 256. Thank you.
Below is my code:
Set rngCasNumberRange = Range("A1:B13242")
intIfCounter = 1
'for loop to loop through column A and search for the first number
entered.
'fill Column D with the number and column E with the code if found
For rwIndex = 1 To 1
For colIndex = 2 To 13242
With Worksheets("SortedByCasNumberAndPhrase").Cells(rwIndex,
colIndex)
If rngCasNumberRange.Cells(colIndex, 1) = strCASNumberOne
Then
'fill variable with phase code corresponding to the cas
number found
strPhaseCodeOne = rngCasNumberRange.Cells(colIndex, 2)
'fill cells with found phrase code numbers
rngCasNumberRange.Cells((intIfCounter + 14), 4).Value =
strCASNumberOne
rngCasNumberRange.Cells((intIfCounter + 14), 5).Value =
strPhaseCodeOne
intIfCounter = intIfCounter + 1
End If
End With
Next colIndex
Next rwIndex
Thanks.