返回列表 上一主題 發帖

[轉貼] Excel 跑馬燈

[轉貼] Excel 跑馬燈

之前在某個網站上看到有人分享的 所以也不吝嗇給大家
程式碼如下:
Option Explicit

Sub auto_open()
    addhtmlobj (CStr(Sheet1.Range("A1")))
End Sub

Sub addhtmlobj(newstr As String)
    Dim fs, a, fn
    fn = ThisWorkbook.Path & "\x.htm"
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set a = fs.CreateTextFile(fn)
    a.WriteLine ("<body scroll=""no"" topmargin=""0"" leftmargin=""0""><marquee>" & _
        newstr & "</marquee></body>")
    a.Close
    Sheet1.WebBrowser1.Navigate ThisWorkbook.Path & "\x.htm"
End Sub

跑馬燈.rar (11.58 KB)

        靜思自在 : 人要自愛,才能愛普天下的人。
返回列表 上一主題