tstrobel
07-28-2011, 01:19 PM
Hello all, I will try to explain my problem. I am using Vlookup to insert alpha-numeric data from a text file into my spreadsheet. Here is part of my code:
Selection.NumberFormat = "000000000"
ActiveCell.FormulaR1C1 = Cusip(i)
ActiveCell.FormulaR1C1 = "=TEXT(" & ActiveCell & ",""000000000"")"
The Cusip info is pulled from SQL. This code is before the Vlookup code. The code above works fine as long as the data is actually all numbers, "023375868" and the Vlookup works correctly. But when I get to this type of data, "00141M515" I get this error message: Run-time error '1004' Application defined or object defined error and won't let me go on.
:help
Selection.NumberFormat = "000000000"
ActiveCell.FormulaR1C1 = Cusip(i)
ActiveCell.FormulaR1C1 = "=TEXT(" & ActiveCell & ",""000000000"")"
The Cusip info is pulled from SQL. This code is before the Vlookup code. The code above works fine as long as the data is actually all numbers, "023375868" and the Vlookup works correctly. But when I get to this type of data, "00141M515" I get this error message: Run-time error '1004' Application defined or object defined error and won't let me go on.
:help