excel - Change the format of cells using formulas -


hello i'd change format of cells column "i" "0000" format, using formula (consequently not using .numberformat method) , vba.

for instance if range("a1").value = 09, formula transform 0009, etc.

i have tried doesn't work :

with range("i2", cells(rows.count, "i").end(xlup))    .value = evaluate("index(text(" & .address(external:=true) & ",""0000""),)") end 

thank in advance help, sincerely, j.garry

non vba

=right("000"&a1,4) 

basically tag on bunch of 0s on front converts number string, take last 4 characters. assuming working integers , not thrown off decimal points.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -