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

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -