'Excel VBA - Copy a Column from Table"TBL_IMPORT" and change value during coping
I use
Sheets"PrepCalc".ListObjects("TBL_PrepCalc").ListColumns.Add ...
to copy some whole columns from a "TBL_IMPORT" table on an "Import" Sheet. Works fine.
But there are Columns that need some adjustment and calculation, like f.e. Sheet "Import" - Table "TBL_IMPORT" Column "Area" contains the text string "125000000000mm3" and needs to be placed as '12,5' (as a number) in the column "Area" at the end of the "TBL_PrepCalc" table.
Another column named "width" is also text with f.e "38mm" as value and has to read in the new column as a number value '38'.
The import table can contain 4500-10000+ rows and 18 columns. ± Half of the columns needs to be changed when copied. What is the best way to work as efficiently as possible?
At first I was thinking to walk through each row, create an universal function that take the "import_table_column" as argument1; the function "Do_the_Area_convert()" that do the math as a argument2; target column as Argument3.
Any suggestions? Being looking for this at this forum and googling around the world, but still haven' found what I'am looking for.
thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
