I AM Scrapping excel to Attachmate
in excel each cell has different format
i need to have format in macro in general
how do i format the cells in macro
Printable View
I AM Scrapping excel to Attachmate
in excel each cell has different format
i need to have format in macro in general
how do i format the cells in macro
cell or range numberformat, is the format of the cell/s
westconn
i want the format cell genaral
becasue for example if i have in cell e has 09000
only if the format is in generl we can enter 000
if it is number it shows only 9000
if it is text it shows only 9000
if it is general we cna enter 09000
how do i write in vba code
and my code fully cell(1, "e") it works find
but i saw here range("e1") and cells(1, 5)
if iput cells(1. "e") it works i dont find any problem but does it affect anything
i learned lot from you Westconn. you explalin this also.
i think you have it round the wrong way, in general it will only allow numbers to be numbers (leading zeroes will be removed), numbers prefixed with zero are strings and can only work if the cell is formatted as text
to format range /cell as text
range("a1").numberformat = "@"
to format as general
range("a1).numberformat = "general"
it makes no difference as far as i am aware, which of those you use and there are some other methods too, like r1c1Quote:
and my code fully cell(1, "e") it works find
but i saw here range("e1") and cells(1, 5)
if iput cells(1. "e") it works i dont find any problem but does it affect anything