excel macro export to xml format

来源:互联网 发布:网龙网络控股有限公司 编辑:程序博客网 时间:2024/05/23 00:01
Sub createtxt()

Dim Rng As Range

  Dim obj, blogTxt

    For Each Rng In Range("A1:A100")

        Myname = Rng

        MyText = Rng.Offset(0, 0)

    

    Set obj = CreateObject("scripting.filesystemobject")


    Set blogTxt = obj.OpenTextFile("c:\ab.txt", 8, True)
    
 
    '<option value="911 Targa 996">911 Targa 996</option>
    If MyText <> "" Then
        blogTxt.Write "<option value='" & MyText & "'>" & MyText & "</option>" & vbCrLf
    End If
    'blogTxt.Write MyText & vbCrLf
    blogTxt.Close

    Set obj = Nothing

    Set blogTxt = Nothing
    
    If MyText = "" Then
        GoTo a
    End If

 Next
a:
 
 
End Sub

0 0
原创粉丝点击