I have a table linked to a SQL database that I use to create some reports. The problem is that the numbers come as text and I have to convert them to numbers everytime,
I've wrote a macro to create the report but I'm having trouble to convert the numbers. I tried to multiply the whole table by one (the table lose the link but it's not an issue, since I'll just copy the infos to another workbook and them close the table w/o saving) and it worked when I did it manualy, but when I do it via macro it won't work. I can see it multiplying by 1 but the numbers are still texts.
Since my table is huge, trying to convert each cell is not an options sice it'd take forever to run each cell and use the CStr function.
My code:
Range("B2").Copy
Range("A4", Range("AC4").End(xlDown)).PasteSpecial Paste:=xlPasteValues, Operation:=xlMultiply, _
SkipBlanks:=False, Transpose:=False
Any suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…