Excel 2003:
某一个字符串(比较长)遇到空格就截取某段写入到Excel表格中去
比如
Dim str as string
str="I love you more than i can say"
在表格中,第一行一列显示I,二列显示love……
这个算法要怎么写呀?

解决方案 »

  1.   

    1:这叫写法,不叫算法。
    2:写法如下:
    Dim str as string 
    dim strS() as string
    dim i as integerstr="I love you more than i can say" 
    strs=split(str)
    for i=0 to ubound(strs)
        application.cells(1,i+1)=strs(i)
    next 
      

  2.   


    就这么简单呀,你没试?
    split(str)(i)   i为变量
    自己试一下就知道了
      

  3.   

    好的哦,谢谢啊,问下VBA有没有一些可以查询函数的文档啊,就像MSDN
      

  4.   

    呵呵,不好意思,这几天才开始接触VBA,一头雾水,呵呵,一直在写算法,不知道有这个函数,问下有什么资料可以看不?
      

  5.   

    这个是VB函数。建议楼主需要下个MSDN的VB手册。或者EXCEL自带的VB手册。