<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">


			
<channel>

	<title><![CDATA[留言: 留言簿 (Emily 分享學習 VBA)]]></title>
	<description><![CDATA[留言簿: 最新回應 ]]></description>
	<link>http://cat14051.mysinablog.com/index.php?op=GuestBook</link>

		<lastBuildDate>Sun, 08 Nov 2009 22:06:08 +0800</lastBuildDate>

<generator>mysinablog-2.0</generator>

<image>
	<url>http://mysinablog.com/gallery/202/23/6090/profile.jpg</url>

<title><![CDATA[留言: 留言簿 (Emily 分享學習 VBA)]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook</link>

</image>


<item>
<title><![CDATA[By: cliff]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6488689</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6488689</guid>
<dc:creator><![CDATA[cliff]]></dc:creator>
<pubDate>Sun, 08 Nov 2009 22:06:08 +0800</pubDate>

<content:encoded><![CDATA[
<p>thx very useful !</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: Emily]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6347239</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6347239</guid>
<dc:creator><![CDATA[Emily]]></dc:creator>
<pubDate>Sun, 01 Nov 2009 01:11:12 +0800</pubDate>

<content:encoded><![CDATA[
<blockquote><strong>cliff</strong> : i have the VBA scripts (usually update) in the cells of excel.I need to copy and paste the range of cell into the module.Do you have any VBA scripts that can have a fast way? Thank you very much!</blockquote><p>Programming The VBA Editor</p><p><a href="http://www.cpearson.com/excel/vbe.aspx">http://www.cpearson.com/excel/vbe.aspx</a></p><p>---&gt; Adding A Procedure To A Module</p><p>&nbsp;</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: cliff]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6346665</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6346665</guid>
<dc:creator><![CDATA[cliff]]></dc:creator>
<pubDate>Sat, 31 Oct 2009 18:27:06 +0800</pubDate>

<content:encoded><![CDATA[
<p>i have the VBA scripts (usually update) in the cells of excel.<br />
I need to copy and paste the range of cell into the module.<br />
Do you have any VBA scripts that can have a fast way? Thank you very much!</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: Emily]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6325716</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6325716</guid>
<dc:creator><![CDATA[Emily]]></dc:creator>
<pubDate>Mon, 26 Oct 2009 20:50:53 +0800</pubDate>

<content:encoded><![CDATA[
<p>Can you post question in <a href="http://www.excelhelp.net/cgi-bin/forum/leoboard.cgi">ExcelHelp</a> with attachment and data. Thanks</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: cliff]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6305380</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6305380</guid>
<dc:creator><![CDATA[cliff]]></dc:creator>
<pubDate>Fri, 23 Oct 2009 01:22:58 +0800</pubDate>

<content:encoded><![CDATA[
<p>Thx very useful!</p>
<p>I want to ask one question</p>
<p>If each row in excel for one email, I want to set column H to column K as the email body, how can i set the range and use the function of RangetoHTML</p>
<p>My code is here    can u give me some idea how to write</p>
<p>Sub email()<br />
    Dim OutApp As Object<br />
    Dim OutMail As Object<br />
    Dim cell As Range, FileCell As Range, rng As Range, ck As Range<br />
    Dim strbody As String<br />
    Dim sh As Worksheet<br />
    Set sh = Sheets("Sheet1")<br />
    Set ck = sh.Cells(cell.Row, 1).Range("H1:K1")<br />
    strbody = sh.Cells(cell.Row, "H").Value &amp; "<br />" &amp; _<br />
              sh.Cells(cell.Row, "I").Value &amp; "<br />" &amp; _<br />
              sh.Cells(cell.Row, "J").Value &amp; "<br /><br /><br />" &amp; _<br />
              sh.Cells(cell.Row, "K").Value &amp; "<br /><br /><br /><br />"</p>
<p>    Set OutApp = CreateObject("Outlook.Application")<br />
    OutApp.Session.Logon</p>
<p>    For Each cell In Columns("C").Cells.SpecialCells(xlCellTypeConstants)<br />
       Set rng = sh.Cells(cell.Row, 1).Range("F1:G1")<br />
      If cell.Value Like "?*@?*.?*" And _<br />
           LCase(Cells(cell.Row, "D").Value) = "y" Then<br />
       If cell.Value Like "?*@?*.?*" And _<br />
           Application.WorksheetFunction.CountA(rng) &gt; 0 Then<br />
            Set OutMail = OutApp.CreateItem(0)<br />
            With OutMail<br />
                .To = cell.Value<br />
                .Subject = "Application for the " &amp; Cells(cell.Row, "B").Value<br />
                .HTMLBody = strbody &amp; RangetoHTML(ck)<br />
                 For Each FileCell In rng.SpecialCells(xlCellTypeConstants)<br />
                    If Trim(FileCell)  "" Then<br />
                        If Dir(FileCell.Value)  "" Then<br />
                            .Attachments.Add FileCell.Value<br />
                        End If<br />
                    End If<br />
                Next FileCell<br />
                .Display<br />
                .Send<br />
            End With<br />
         End If<br />
        End If<br />
    Next cell</p>
<p>    Set OutMail = Nothing<br />
    Set OutApp = Nothing</p>
<p>End Sub</p>
<p>Function RangetoHTML(rng As Range)<br />
' Changed by Ron de Bruin 28-Oct-2006<br />
' Working in Office 2000-2007<br />
    Dim fso As Object<br />
    Dim ts As Object<br />
    Dim TempFile As String<br />
    Dim TempWB As Workbook<br />
    TempFile = Environ$("temp") &amp; "/" &amp; Format(Now, "dd-mm-yy h-mm-ss") &amp; ".htm"<br />
    'Copy the range and create a new workbook to past the data in<br />
    rng.copy<br />
    Set TempWB = Workbooks.Add(1)<br />
    With TempWB.Sheets(1)<br />
        .Cells(1).PasteSpecial Paste:=8<br />
        .Cells(1).PasteSpecial xlPasteValues, , False, False<br />
        .Cells(1).PasteSpecial xlPasteFormats, , False, False<br />
        .Cells(1).Select<br />
        Application.CutCopyMode = False<br />
        On Error Resume Next<br />
        .DrawingObjects.Visible = True<br />
        .DrawingObjects.Delete<br />
        On Error GoTo 0<br />
    End With<br />
    'Publish the sheet to a htm file<br />
    With TempWB.PublishObjects.Add( _<br />
         SourceType:=xlSourceRange, _<br />
         Filename:=TempFile, _<br />
         Sheet:=TempWB.Sheets(1).Name, _<br />
         Source:=TempWB.Sheets(1).UsedRange.Address, _<br />
         HtmlType:=xlHtmlStatic)<br />
        .Publish (True)<br />
    End With<br />
    'Read all data from the htm file into RangetoHTML<br />
    Set fso = CreateObject("Scripting.FileSystemObject")<br />
    Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)<br />
    RangetoHTML = ts.ReadAll<br />
    ts.Close<br />
    RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _<br />
                          "align=left x:publishsource=")<br />
    'Close TempWB<br />
    TempWB.Close savechanges:=False<br />
    'Delete the htm file we used in this function<br />
    Kill TempFile<br />
    Set ts = Nothing<br />
    Set fso = Nothing<br />
    Set TempWB = Nothing<br />
End Function</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: Clare]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6299600</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6299600</guid>
<dc:creator><![CDATA[Clare]]></dc:creator>
<pubDate>Wed, 21 Oct 2009 11:46:38 +0800</pubDate>

<content:encoded><![CDATA[
<blockquote><b>Emily</b> :<br />
ExcelHome, OfficeFans 有破密码帖子, 自己找</blockquote>
<br /></p>
<p>已在ExcelHome里找到，谢谢指教!!</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: Emily]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6299447</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6299447</guid>
<dc:creator><![CDATA[Emily]]></dc:creator>
<pubDate>Wed, 21 Oct 2009 10:37:03 +0800</pubDate>

<content:encoded><![CDATA[
<p><a href="http://www.thecodecage.com/forumz/excel-vba-programming/135905-outlook-body-text-bold.html">http://www.thecodecage.com/forumz/excel-vba-programming/135905-outlook-body-text-bold.html</a></p><p>&nbsp;</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: cliff]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6294505</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6294505</guid>
<dc:creator><![CDATA[cliff]]></dc:creator>
<pubDate>Mon, 19 Oct 2009 23:06:58 +0800</pubDate>

<content:encoded><![CDATA[
<p>How to set the text format (Bold and underline) in email body to a particular cells (Cell J only) ?</p>
<p>some suggests the function to me but dunno how to merge the function into the vba code</p>
<p>the vba code is below:</p>
<p>Sub email()<br />
    Dim OutApp As Object<br />
    Dim OutMail As Object<br />
    Dim cell As Range, FileCell As Range, rng As Range<br />
    Dim strbody As String<br />
    Dim sh As Worksheet<br />
    Set sh = Sheets("Sheet1")<br />
    For Each cell In Range("E1:E25")<br />
    strbody = strbody &amp; cell.Value &amp; vbNewLine<br />
    Next<br />
    Set OutApp = CreateObject("Outlook.Application")<br />
    OutApp.Session.Logon</p>
<p>    For Each cell In Columns("C").Cells.SpecialCells(xlCellTypeConstants)<br />
       Set rng = sh.Cells(cell.Row, 1).Range("F1:G1")<br />
      If cell.Value Like "?*@?*.?*" And _<br />
           LCase(Cells(cell.Row, "D").Value) = "y" Then<br />
       If cell.Value Like "?*@?*.?*" And _<br />
           Application.WorksheetFunction.CountA(rng) &gt; 0 Then<br />
            Set OutMail = OutApp.CreateItem(0)<br />
            With OutMail<br />
                .To = cell.Value<br />
                .Subject = "Application for the " &amp; Cells(cell.Row, "B").Value<br />
                .Body = Cells(cell.Row, "H").Value &amp; vbNewLine &amp; Cells(cell.Row, "I").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "J").Value &amp; vbNewLine &amp; Cells(cell.Row, "K").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "L").Value &amp; vbNewLine &amp; Cells(cell.Row, "M").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "N").Value &amp; vbNewLine &amp; Cells(cell.Row, "O").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "P").Value &amp; vbNewLine &amp; Cells(cell.Row, "Q").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "R").Value &amp; vbNewLine &amp; Cells(cell.Row, "S").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "T").Value &amp; vbNewLine &amp; Cells(cell.Row, "U").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "V").Value &amp; vbNewLine &amp; Cells(cell.Row, "W").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "X").Value &amp; vbNewLine &amp; Cells(cell.Row, "Y").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "Z").Value &amp; vbNewLine &amp; Cells(cell.Row, "AA").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AB").Value &amp; vbNewLine &amp; Cells(cell.Row, "AC").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AD").Value &amp; vbNewLine &amp; Cells(cell.Row, "AE").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AF").Value &amp; vbNewLine &amp; Cells(cell.Row, "AG").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AH").Value &amp; vbNewLine &amp; Cells(cell.Row, "AI").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AJ").Value &amp; vbNewLine &amp; Cells(cell.Row, "AK").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AL").Value &amp; vbNewLine &amp; Cells(cell.Row, "AM").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AO").Value &amp; vbNewLine &amp; Cells(cell.Row, "AP").Value &amp; vbNewLine _<br />
                        &amp; Cells(cell.Row, "AQ").Value &amp; vbNewLine</p>
<p>               For Each FileCell In rng.SpecialCells(xlCellTypeConstants)<br />
                    If Trim(FileCell)  "" Then<br />
                        If Dir(FileCell.Value)  "" Then<br />
                            .Attachments.Add FileCell.Value<br />
                        End If<br />
                    End If<br />
                Next FileCell<br />
                .Display<br />
                .Send<br />
            End With<br />
         End If<br />
        End If<br />
    Next cell</p>
<p>    Set OutMail = Nothing<br />
    Set OutApp = Nothing</p>
<p>End Sub</p>
<p>Function RangetoHTML(rng As Range)<br />
' Changed by Ron de Bruin 28-Oct-2006<br />
' Working in Office 2000-2007<br />
    Dim fso As Object<br />
    Dim ts As Object<br />
    Dim TempFile As String<br />
    Dim TempWB As Workbook<br />
    TempFile = Environ$("temp") &amp; "\" &amp; Format(Now, "dd-mm-yy h-mm-ss") &amp; ".htm"<br />
    'Copy the range and create a new workbook to past the data in<br />
    rng.copy<br />
    Set TempWB = Workbooks.Add(1)<br />
    With TempWB.Sheets(1)<br />
        .Cells(1).PasteSpecial Paste:=8<br />
        .Cells(1).PasteSpecial xlPasteValues, , False, False<br />
        .Cells(1).PasteSpecial xlPasteFormats, , False, False<br />
        .Cells(1).Select<br />
        Application.CutCopyMode = False<br />
        On Error Resume Next<br />
        .DrawingObjects.Visible = True<br />
        .DrawingObjects.Delete<br />
        On Error GoTo 0<br />
    End With<br />
    'Publish the sheet to a htm file<br />
    With TempWB.PublishObjects.Add( _<br />
         SourceType:=xlSourceRange, _<br />
         Filename:=TempFile, _<br />
         Sheet:=TempWB.Sheets(1).Name, _<br />
         Source:=TempWB.Sheets(1).UsedRange.Address, _<br />
         HtmlType:=xlHtmlStatic)<br />
        .Publish (True)<br />
    End With<br />
    'Read all data from the htm file into RangetoHTML<br />
    Set fso = CreateObject("Scripting.FileSystemObject")<br />
    Set ts = fso.GetFile(TempFile).OpenAsTextStream(1, -2)<br />
    RangetoHTML = ts.readall<br />
    ts.Close<br />
    RangetoHTML = Replace(RangetoHTML, "align=center x:publishsource=", _<br />
                          "align=left x:publishsource=")<br />
    'Close TempWB<br />
    TempWB.Close savechanges:=False<br />
    'Delete the htm file we used in this function<br />
    Kill TempFile<br />
    Set ts = Nothing<br />
    Set fso = Nothing<br />
    Set TempWB = Nothing<br />
End Function</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: cliff]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6294397</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6294397</guid>
<dc:creator><![CDATA[cliff]]></dc:creator>
<pubDate>Mon, 19 Oct 2009 22:45:31 +0800</pubDate>

<content:encoded><![CDATA[
<p>hi</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: Emily]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6286275</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6286275</guid>
<dc:creator><![CDATA[Emily]]></dc:creator>
<pubDate>Mon, 19 Oct 2009 12:46:55 +0800</pubDate>

<content:encoded><![CDATA[
<blockquote><b>Clare</b> :<br />
Emily,您好.<br />
我自己在试着制作一张worksheet,可以提供给多人使用,为了记录每个人的修改或编辑动作,我想在excel中提取编辑者的名字以及编辑时间。因此我在GOOGLE中搜到了您的blog中曾经有介绍,链接是<br />
遗憾的是我无法打开,系统提示说需要密码.不知是否能分享一下。谢谢!!</blockquote>
<br /></p>
<p>链接是 ???</p>
<p>ExcelHome, OfficeFans 有破密码帖子, 自己找</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: Clare]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6268706</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6268706</guid>
<dc:creator><![CDATA[Clare]]></dc:creator>
<pubDate>Thu, 15 Oct 2009 14:54:50 +0800</pubDate>

<content:encoded><![CDATA[
<p>Emily,您好.</p>
<p>我自己在试着制作一张worksheet,可以提供给多人使用,为了记录每个人的修改或编辑动作,我想在excel中提取编辑者的名字以及编辑时间。因此我在GOOGLE中搜到了您的blog中曾经有介绍,链接是</p>
<p>遗憾的是我无法打开,系统提示说需要密码.不知是否能分享一下。谢谢!!</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: vicky]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6265165</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6265165</guid>
<dc:creator><![CDATA[vicky]]></dc:creator>
<pubDate>Wed, 14 Oct 2009 19:44:15 +0800</pubDate>

<content:encoded><![CDATA[
<p>我想問你休假表excel怎摹作</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: celsey]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6099023</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6099023</guid>
<dc:creator><![CDATA[celsey]]></dc:creator>
<pubDate>Fri, 04 Sep 2009 17:23:54 +0800</pubDate>

<content:encoded><![CDATA[
<p>你怎麼看待冬天，我喜歡冬天嗎？</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: enhung]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6091650</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6091650</guid>
<dc:creator><![CDATA[enhung]]></dc:creator>
<pubDate>Wed, 02 Sep 2009 22:59:21 +0800</pubDate>

<content:encoded><![CDATA[
<p>我的問題其實很簡單，想像各位請教。</p>
<p>如何檢查文件尾？ 除了EOF之外。</p>
<p>我在已經打開的Word裡，尋找特定文字，但是，因為不能一次全部尋找後更換，而是要逐筆尋找，然後決定處理方式。</p>
<p>我讓該macro設定快速鍵，逐次執行。<br />
為了怕執行到文件尾會進入迴圈，所以要檢查文件尾。</p>
<p>不知各位如何檢查？使用什麼物件或方法？</p>

]]></content:encoded>

</item>


<item>
<title><![CDATA[By: pojen]]></title>
<link>http://cat14051.mysinablog.com/index.php?op=GuestBook#6067242</link>
<guid>http://cat14051.mysinablog.com/index.php?op=GuestBook#6067242</guid>
<dc:creator><![CDATA[pojen]]></dc:creator>
<pubDate>Fri, 28 Aug 2009 21:37:10 +0800</pubDate>

<content:encoded><![CDATA[
<p>牛肉湯60<br />
乾麵40<br />
湯麵35<br />
麻醬麵35<br />
炒飯 50</p>
<p>假設我做了5個按鈕如上，現在要點菜了，我按了牛肉湯和乾麵。</p>
<p>程式會自動印出你點的菜和價錢和總價。</p>
<p>可以給點提示嗎?<br />
感謝</p>

]]></content:encoded>

</item>

</channel>
</rss>