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
Post a Comment