I have a table associated with an 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 every time. I wrote a macro to create a report, but it's hard for me to convert the numbers. I tried to multiply the entire table by one (the table will lose the link, but this is not a problem, since I just copy the information to another book and they close the table without saving), and it worked when I did it manually, but when I do it through a macro, this will not work. I see that it is multiplied by 1, but the numbers are still texts.
Since my table is huge, trying to convert every cell is not a parameter, it would take forever to execute each cell and use the CStr function.
My code is:
Range("B2").Copy Range("A4", Range("AC4").End(xlDown)).PasteSpecial Paste:=xlPasteValues, Operation:=xlMultiply, _ SkipBlanks:=False, Transpose:=False
Any suggestions?
vba excel-vba excel
Fabio rebelo
source share