excel - How to check if a command is possible before executing it in vba? -


i want use macro change long long column of cells. cells either numbers or text. numbers, though, stored text , want convert them. i'd like

`range("a1").value = int(range("a1").value)` 

, , works fine when converting numbers stored text number, won't work values text , have no numbers. how set command see, if conversion possible it?

do them @ once range.texttocolumns method. vba's overhead take care of error control.

with worksheets("sheet1")     intersect(.usedrange, .columns(1))         .numberformat = "general"         .texttocolumns datatype:=xlfixedwidth, fieldinfo:=array(0, 1)     end end 

Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

javascript - How to change image src on success AJAX -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -