Too much code for a simple task:
sub M_snb()
with CreateObject("Wscript.Shell")
for each cl in sheet1.columns(1).specialcells(2).offset(1).specialcells(2)
cl.offset(,3)= .Exec("cmd /c " & cl).StdOut.ReadAll
next
end with
End Sub
or (faster)
sub M_snb()
sn=sheet1.columns(1).specialcells(2).offset(1).specialcells(2)
with CreateObject("Wscript.Shell")
for j=1 to ubound(sn)
sn(j,1)= .Exec("cmd /c " & sn(j,1)).StdOut.ReadAll
next
end with
sheet1.columns(1).specialcells(2).offset(1).specialcells(2).offset(,3)=sn
End Sub