Need to replace about 10.000 items in xls column with 50.000 data. In Module I exceed maximum number lines of code. How to reduce number of lines with code? (WIN XP, Off2003). Any suggestions? (arrays?, list?,..)
If all you are doing is find and replace then is code necessary? If it is then the help file will help you. Beut without knowing more of what you are trying to do I don't think anyone will be able to help fully.
In xls book with data column (50.000) numbers as text - (about 10.000 unique, others are duplicates -must not delete duplicates)I need to replace all numbers with new text (OBV, BLAG,..)
I have separate table with unique 10.000 numbers (1032226,1020051,...).They must be converted with defined, another text(1032226>OBV, 1020051>OBV, 1120009>BLAG,..).
When I create all raplaces in code, I get error: too much lines in code.
Is your first set of data (the 50,000 numbers) just a list on its own, is it just a column of numbers?
What does your second table look like? Is it a list of numbers with the relevant replacements next to them? What purpose does it serve? Do you need to do the same replacement exercise on this table?
Do you have a list (in Excel) showing which numbers need to be replaced with which text?
Create a conversion table with, say, numbers in column A and corresponding text in column B.
Then in your code inside a loop in this table varying the row (say lngRow):
Selection.Replace What:=conversionSheetObj.Cells(lngRow, 1), Replacement:=conversionSheetObj.Cells(lngRow, 2), LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=True
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.