Friday, November 25, 2011

Changing to text in Excel

I find that I have to do this once in a while and every time I'll have to look it up again. Basically the problem is that someone sent an excel file which the column need to be a string but the data is numerical, so without adding the tick in front of the number, excel interprets it as number. Here's the small script to add the tick:

For i = 2 to 196
    Range("C" & i).Select
    ActiveCell.FormulaR1C1 = "'" & ActiveCell.Value
Next
Now I won't have to google all those mysterious command again the next time it happens.. p/s: don't laugh at me struggling with vb you insensitive clod.. :P

1 comment:

Insensitive Clod said...

hahahahahahahahhaha vb hahahahahahahahaha

Is Blogging No Longer a Thing?

As I embark on my new journey to learn the Rust programming language, I find myself pondering—where have all the blogs gone? In search of pr...