<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fanhow &#187; excel</title>
	<atom:link href="http://blog.fanhow.com/tag/excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fanhow.com</link>
	<description>Social Media and Recipes for Software</description>
	<lastBuildDate>Mon, 07 Jun 2010 12:33:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Basic While Essential Excel Macros You Must Grab</title>
		<link>http://blog.fanhow.com/2009/11/basic-while-essential-excel-macros-you-must-grab/</link>
		<comments>http://blog.fanhow.com/2009/11/basic-while-essential-excel-macros-you-must-grab/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 07:26:12 +0000</pubDate>
		<dc:creator>Recipebeta</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://blog.recipester.org/?p=450</guid>
		<description><![CDATA[A macro is a rule or pattern that specifies how a certain input sequence should be mapped to an output sequence according to a defined procedure. A macro in Excel is a set of instructions that can be triggered by a keyboard shortcut, toolbar button or an icon in a spreadsheet.
Excel macro is extremely convenient [...]]]></description>
			<content:encoded><![CDATA[<p>A macro is a rule or pattern that specifies how a certain input sequence should be mapped to an output sequence according to a defined procedure. A macro in Excel is a set of instructions that can be triggered by a keyboard shortcut, toolbar button or an icon in a spreadsheet.</p>
<p>Excel macro is extremely convenient for repeated tasks. In Excel, macros are written in Visual Basic for Applications (VBA). For those who cannot write VBA code, Excel allows you to record a series of steps &#8211; using keyboard and mouse &#8211; that Excel then converts into VBA.<span id="more-450"></span><strong></strong></p>
<p><strong>1. Selecting the Active Workbook</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ThisWorkbook.Activate</span></p>
<p align="left">In case you want to select an opening Excel document, the file extension is necessary.</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Windows(&#8221;Example.xls&#8221;).Activate</span></p>
<p align="left"><strong>2. Selecting a Worksheet</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Sheets(&#8221;Balance&#8221;).Activate</span></p>
<p align="left"><strong>3. Selecting a Cell</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;).Select</span></p>
<p align="left"><strong>4. Selecting Continuous Cells</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A2:F8&#8243;).Select</span></p>
<p align="left"><strong>5. Selecting Non-continuous Cells</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A2,C6,D9&#8243;).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1,B5:B10,F9&#8243;).Select</span></p>
<p align="left"><strong>6. Move/Offset the Cells</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ActiveCell.Offset(12, 16).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(-1, -6).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;D8&#8243;).Offset(-2, -8).Select</span></p>
<p align="left"><strong>7. Selecting the Entire Worksheet</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Cells.Select</span></p>
<p align="left"><strong>8. Selecting the Range Where the Active Cell Locates</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;).CurrentRegion.Select</span></p>
<p align="left"><strong>9. Select a Row or Column</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Rows(&#8221;1&#8243;).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Columns(&#8221;A&#8221;).Select</span></p>
<p align="left"><span style="color: #000000">or</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ActiveCell.EntireRow.Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ActiveCell.EntireColumn.Select</span></p>
<p align="left"><strong>10. Select Contiguous Rows or Columns</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Columns(&#8221;A:C&#8221;).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Rows(&#8221;1:10&#8243;).Select</span></p>
<p align="left"><strong>11. Select Non-contiguous Rows or Columns</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A:A, C:D, E:F&#8221;).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;1:1,5:8,9:9&#8243;).Select</span></p>
<p align="left"><strong>12. Select a Range downwards from the Active Cell</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;, Range(&#8221;A1&#8243;).End(xlDown)).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(ActiveCell, ActiveCell.End(xlDown)).Select</span></p>
<p align="left"><strong>13. Select a Range upwards from the Active Cell</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A32&#8243;, Range(&#8221;A32&#8243;).End(xlUp)).Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(ActiveCell, ActiveCell.End(xlUp)).Select</span></p>
<p align="left"><strong>14. Select a Range rightward from the Active Cell</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;, Range(&#8221;A1&#8243;).End(xltoRight)).Select</span></p>
<p align="left"><strong>15. Select a Range leftward from the Active Cell</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(ActiveCell, ActiveCell.End(xltoLeft)).Select</span> </p>
<p align="left"><strong>16. Select the first blank cell from the active row</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;).End(xltoRight).Offset(0,1).Select</span></p>
<p align="left"><strong>17. Macros about &#8220;If..Then&#8230;EndIf&#8221;</strong></p>
<p align="left"> If there’s only one condition and action, you can write code as follows:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value &gt; 10 Then</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 100</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End If</span></p>
<p align="left"> Or:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value &gt; 10 Then Selection.Offset(1,0) = 100</span></p>
<p align="left">For more conditions and actions, you should do the following:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value &gt; 10 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">If Selection.Value = 12 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 100</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">End If</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 20</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End If</span></p>
<p align="left"><strong>18. Macro about &#8220;f..Then&#8230;And&#8230;EndIf&#8221;</strong></p>
<p align="left">For bio-conditions:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value = 10 And Selection.Offset(0,1).Value = 20 Then</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 100</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End If</span></p>
<p align="left"><strong>19. Macro about &#8220;f..Then&#8230;Or&#8230;EndIf&#8221;</strong></p>
<p align="left">For bio-conditions:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value = 10 Or Selection.Offset(0,1).Value = 20 Then</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 100</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End If</span></p>
<p align="left"><strong>20. Macro about &#8220;if..Then&#8230;Else&#8230;EndIf&#8221;</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value &gt; 10 Then</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 100</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Else</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Selection.Offset(1,0) = 0</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End If</span></p>
<p align="left"><strong>21. Macro about &#8220;If..Then..ElseIf&#8230;EndIf&#8221;</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">If Selection.Value = 1 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(1, 0) = 10</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ElseIf Selection.Value = 2 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(1, 0) = 20</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ElseIf Selection.Value = 3 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(1, 0) = 30</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ElseIf Selection.Value = 4 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(1, 0) = 40</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">ElseIf Selection.Value = 5 Then</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(1, 0) = 50</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End If</span></p>
<p align="left"><strong>22. Macro about &#8220;Select Case&#8221;</strong></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Sub Test()</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Select Case Selection.Value</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Case Is &gt;= 85</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(0, 1) = &#8220;A&#8221;</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Case Is &gt;= 75</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(0, 1) = &#8220;B&#8221;</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Case Is &gt;= 65</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(0, 1) = &#8220;C&#8221;</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Case Is &gt;= 50</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(0, 1) = &#8220;D&#8221;</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Case Else</span></p>
<p style="padding-left: 60px" align="left"><span style="color: #0000ff">Selection.Offset(0, 1) = &#8220;F&#8221;</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End Select</span></p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">End Sub</span></p>
<p align="left"><strong>23. Example of LCase, Now() and UCase Functions</strong></p>
<p align="left">To convert uppercase to lowercase using LCase function:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Select Case LCase(Selection.value)</span></p>
<p align="left">To show the current time in cell A1:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;).Formula = &#8220;=Now()&#8221;</span></p>
<p align="left">To show current time in cell A1 as fixed value that doesn’t change until you execute it once more:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Range(&#8221;A1&#8243;).Value = Now()</span></p>
<p align="left">To convert lowercase to uppercase:</p>
<p style="padding-left: 30px" align="left"><span style="color: #0000ff">Select Case UCase(Selection.value)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fanhow.com/2009/11/basic-while-essential-excel-macros-you-must-grab/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>File Operations in Excel VBA: Using Workbooks and Worksheets Objects</title>
		<link>http://blog.fanhow.com/2009/11/file-operations-in-excel-vba-using-workbooks-and-worksheets-objects/</link>
		<comments>http://blog.fanhow.com/2009/11/file-operations-in-excel-vba-using-workbooks-and-worksheets-objects/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 08:05:26 +0000</pubDate>
		<dc:creator>Recipebeta</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[macro]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://blog.recipester.org/?p=356</guid>
		<description><![CDATA[During daily use of Microsoft Excel, we don’t only access data on active Excel document, but also access data on other types of documents, which may be Excel documents, text documents or database files. Considering many friends have trouble on how to operate data with VBA, this serial article will give systematical introductions on four [...]]]></description>
			<content:encoded><![CDATA[<p>During daily use of Microsoft Excel, we don’t only access data on active Excel document, but also access data on other types of documents, which may be Excel documents, text documents or database files. Considering many friends have trouble on how to operate data with VBA, this serial article will give systematical introductions on four methods to access data using VBA in Microsoft Excel. The first is to use Workbooks and Worksheets object. It&#8217;s very convenient to use Excel&#8217;s Workbooks Collection and Workbook object to access external data.<span id="more-356"></span></p>
<p><strong>1. Opening an Excel Documents</strong><br />
Here we use <em>Workbooks.Open</em> method to open an Excel Document.</p>
<p><em><span style="color: #0000ff">Workbooks.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)</span></em></p>
<p><em>FileName</em> is necessary; it’s the file name of the workbook to open. For the other 14 optional arguments, <em>Password</em> is used a little commonly.</p>
<p>Example:</p>
<p><em><span style="color: #0000ff">Workbooks.Open &#8220;F:\MyExcel.xls&#8221;</span></em></p>
<p><em></em>This code could open MyExcel.xls from the Local Disk (F:).</p>
<p><strong>2. Opening Text Files</strong><br />
You could use <em>Workbooks.Open</em> method to open a text file also, however, <em>OpenText</em> method is recommended. The complete syntax is as below.</p>
<p><em><span style="color: #0000ff">Workbooks.OpenText(FileName, Origin, StartRow, DataType, TextQualifier, ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, Other, OtherChar, FieldInfo, TextVisualLayout, DecimalSeparator, ThousandsSeparator, TrailingMinusNumbers, Local)</span></em></p>
<p>The <em>OpenText</em> method could load and split text data into columns and store them in a single worksheet in a workbook.<br />
However, in actual situation, it’s unnecessary to set complicated arguments. You’d better <strong>record a macro</strong> to load text data into Excel. Here are the simple steps.</p>
<p>a. Click <em>Office Button</em> and select <em>Open</em>.</p>
<div id="attachment_367" class="wp-caption alignnone" style="width: 240px"><img class="size-full wp-image-367" src="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_001.png" alt="Microsoft Excel Text Import Wizard" width="230" height="176" /><p class="wp-caption-text">Microsoft Excel Text Import Wizard</p></div>
<p>b. Select <em>Text Files (*.prn;*.txt;*.scv)</em> as the filter and choose the text file. Click <em>Open</em> to continue.</p>
<div id="attachment_368" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_002.png"><img class="size-medium wp-image-368 " src="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_002-300x240.png" alt="Microsoft Excel Text Import Wizard" width="300" height="240" /></a><p class="wp-caption-text">Microsoft Excel Text Import Wizard</p></div>
<p>c. The <em>Text Import Wizard</em> is ready and in just 3 steps you could finish it.<br />
Determine fixed width of text data:</p>
<div id="attachment_369" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_003.png"><img class="size-medium wp-image-369 " src="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_003-300x215.png" alt="Microsoft Excel Text Import Wizard" width="300" height="215" /></a><p class="wp-caption-text">Microsoft Excel Text Import Wizard</p></div>
<p>d. Set filed width (column breaks):</p>
<div id="attachment_370" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_004.png"><img class="size-medium wp-image-370 " src="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_004-300x215.png" alt="Microsoft Excel Text Import Wizard" width="300" height="215" /></a><p class="wp-caption-text">Microsoft Excel Text Import Wizard</p></div>
<p>e. Select each column and set the data format:</p>
<div id="attachment_371" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_005.png"><img class="size-medium wp-image-371 " src="http://blog.fanhow.com/wp-content/uploads/2009/11/Microsoft_Excel_Text_Import_Wizard_005-300x215.png" alt="Microsoft Excel Text Import Wizard" width="300" height="215" /></a><p class="wp-caption-text">Microsoft Excel Text Import Wizard</p></div>
<p>But how to record macros in Microsoft Excel 2007? Please review this recipe: <a href="http://www.fanhow.com/knowhow:Record_macros_in_Excel_34644387">Record macros in Excel</a>. Be sure to change some parameters in macro code to fit different usages.</p>
<p><strong>3. Opening other Types of Files</strong></p>
<p>It is possible to read XML or Access database files using Excel’s objects. (Note: you have to install Microsoft Excel 2003 or higher to deal with XML files). The OpenXML syntax is here:</p>
<p><em><span style="color: #0000ff">Workbooks.OpenXML(Filename, Stylesheets, LoadOption)</span></em></p>
<p><em>FileName</em> (String type) is the necessary argument.<br />
<em>Stylesheets</em> (Variant type) specifies the XLS to convert XSLT.<br />
<em>LoadOption</em> (Variant type) determines the mode to read XML. <em>LoadOption</em> could be one of the constants of <em>XlXmlLoadOption</em>.<br />
<em>XlXmlLoadOption</em> could be one of the following contstant: <em>xlXmlLoadImportToList</em>, <em>xlXmlLoadMapXml</em>, <em>xlXmlLoadOpenXml</em> or <em>xlXmlLoadPromptUser</em>.</p>
<p>Here’s an example of VBA code to open “MyXML.xml” and display the contents in XML list.</p>
<p><em><span style="color: #0000ff">Sub UseOpenXML()<br />
Application.Workbooks.OpenXML _<br />
Filename:=&#8221;MyXML.xml&#8221;, _<br />
LoadOption:=xlXmlLoadImportToList<br />
End Sub</span></em></p>
<p>The <em>OpenDatabase</em> syntax is:</p>
<p><em><span style="color: #0000ff">Workbooks.OpenDatabase(FileName, CommandText, CommandType, BackgroundQuery, ImportDataAs)</span></em></p>
<p><em>FileName</em> (String type) is the necessary argument to stand for connection string.<br />
<em>CommandText</em> (Variant type) is the command text for query and it’s optional.<br />
<em>CommandType</em> (Variant type) is the query type. It’s also optional. CommandType may be Default, SQL or Table.<br />
<em>BackgroundQuery</em> (Variant type) is the query background.<br />
<em>ImportDataAs</em> (Variant type) defines the query format.</p>
<p>An example to open MyAccess.mdb database file in Excel.</p>
<p><em><span style="color: #0000ff">Sub OpenDatabase()<br />
Workbooks.OpenDatabase FileName:=&#8221;C:\northwind.mdb&#8221;<br />
End Sub</span></em></p>
<p><strong>4. Saving Files</strong></p>
<p>To save a file, you could use the <em>Save</em> or <em>SaveAS</em> method in Workbook object.</p>
<p>The syntax of Save method is simple:</p>
<p><em><span style="color: #0000ff">OneWorkbook.Save</span></em> &#8216;OneWorkbook is a workbook object.</p>
<p>Example:</p>
<p><em><span style="color: #0000ff">ActiveWorkbook.Save</span> (Save the active Workbook)</em></p>
<p>To savesas a workbook ,you should use <em>SaveAs</em> method and specify the new file name.</p>
<p><em><span style="color: #0000ff">OneWorkbook.SaveAs(FileName, FileFormat, Password, WriteResPassword, ReadOnlyRecommended, CreateBackup, AccessMode, ConflictResolution, AddToMru, TextCodepage, TextVisualLayout, Local)</span></em></p>
<p>An example to create a workbook and prompt user to enter name and save it.</p>
<p><em><span style="color: #0000ff">Set NewBook = Workbooks.Add<br />
Do<br />
fName = Application.GetSaveAsFilename<br />
Loop Until fName &lt;&gt; False<br />
NewBook.SaveAs Filename:=fName</span></em></p>
<p>Here, <em>Application.GetSaveAsFilename</em> could call the standard &#8220;Save As&#8221; dialog box and get the file name; <em>Application.GetOpenFileName</em> could call the standard &#8220;Open&#8221; dialog box.</p>
<p><strong>5. Closing Files</strong><br />
To close a file, you can use the <em>Close</em> method of the Worbooks collection or Workbook object. <em>Close</em> method of the Worbooks collection can close all the active workbooks, <em>Close</em> method of the Workbook object can aloes specific workbook.</p>
<p>An example of the Colse method of Workbook object:</p>
<p><em><span style="color: #0000ff">OneWorkboook.Close(SaveChanges, Filename, RouteWorkbook)</span></em></p>
<p>Here, the argument of <em>SaveChanges</em> is to prompt user to save it or not, usually it’s set as <em>False</em> to avoid the dialog box.</p>
<p>An example to close Book1.xls and discard all the changes:</p>
<p><em><span style="color: #0000ff">Workbooks(&#8221;BOOK1.XLS&#8221;).Close SaveChanges:=False</span></em></p>
<p>Another example to close all active workboos and prompt user to save changes or not:</p>
<p><em><span style="color: #0000ff">Workbooks.Close</span></em></p>
<p><strong>6. Summary</strong><br />
Using Workbooks and Worksheets Objects to access data is the most simple and convenient way for beginners of Excel VBA. This method is also the top choice to only read data from Excel spreadsheets. So, the next post is on <em>how to do file operations using VBA (Visual Basic for Applications)’s build-in functions</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fanhow.com/2009/11/file-operations-in-excel-vba-using-workbooks-and-worksheets-objects/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Experience of the Microsoft Office Web Apps &#8211; Strong Catalyst on Cloud Office</title>
		<link>http://blog.fanhow.com/2009/10/experience-of-the-microsoft-office-web-apps-strong-catalyst-on-cloud-office/</link>
		<comments>http://blog.fanhow.com/2009/10/experience-of-the-microsoft-office-web-apps-strong-catalyst-on-cloud-office/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 02:17:28 +0000</pubDate>
		<dc:creator>Recipebeta</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[onenote]]></category>
		<category><![CDATA[owa]]></category>
		<category><![CDATA[powerpoint]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://blog.recipester.org/?p=74</guid>
		<description><![CDATA[
Microsoft has launched Office Web Apps Technical Preview on Sep 17, 2009, which contains four free components (Word Web App, PowerPoint Web App, Excel Web App, OneNote Web App). In this preview of online version of Microsoft office, view and share of Word documents, view, editing and creation of Excel spreadsheets, view &#38; editing of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Office_Web_Apps.png"><img class="alignnone size-medium wp-image-93" src="http://blog.fanhow.com/wp-content/uploads/2009/10/Office_Web_Apps-300x249.png" alt="Office_Web_Apps" width="300" height="249" /></a><a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Excel_Web_App_Editing.png"></a></p>
<p>Microsoft has launched <a href="http://www.microsoft.com/presspass/features/2009/Sep09/09-17OfficeWebApps.mspx">Office Web Apps Technical Preview</a> on Sep 17, 2009, which contains four free components (Word Web App, PowerPoint Web App, Excel Web App, OneNote Web App). In this preview of online version of Microsoft office, view and share of Word documents, view, editing and creation of Excel spreadsheets, view &amp; editing of PowerPoint presentations are allowed; however, OneNote Web App will be available at a later date.</p>
<p>If you don&#8217;t have an invitation to test OWA, please get access to Web-based Microsoft Office Apps with a <a href="http://www.labnol.org/internet/access-web-based-microsoft-office/9884/">Special Way</a>.<span id="more-74"></span></p>
<p><strong>Word Web App</strong><br />
You need to upload a word document to the Skydive firstly. There are only basic view functions in Word Web App.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App1.png"><img class="alignnone size-medium wp-image-55" src="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App1-300x181.png" alt="Word_Web_App" width="300" height="181" /></a></p>
<p>From the File menu, you can print the online document. After you select Print, Word Web App will try to connect to your default printer to prepare the printing (The Print feature is only available in Word Web App).</p>
<div id="attachment_38" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App_File_Menu.png"><img class="size-medium wp-image-38 " src="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App_File_Menu-300x276.png" alt="Word Web App File Menu" width="300" height="276" /></a><p class="wp-caption-text">Word Web App File Menu</p></div>
<p>Beside, you can search text in the document through the convenient Find feature. The document parts which matched with your items will be listed in the sidebar, and keywords will be highlighted in the body at the same time.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App_Find_Feature.png"><img class="alignnone size-medium wp-image-39" src="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App_Find_Feature-300x181.png" alt="Word_Web_App_Find_Feature" width="300" height="181" /></a></p>
<p>There is also a simple zoom tool to set different zoom level.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App_Zoom_Level.png"><img class="alignnone size-medium wp-image-40" src="http://blog.fanhow.com/wp-content/uploads/2009/10/Word_Web_App_Zoom_Level-300x250.png" alt="Word_Web_App_Zoom_Level" width="300" height="250" /></a></p>
<p><strong>PowerPoint Web App</strong><br />
You can directly upload or create a PowerPoint presentation. In the slide show mode, you could click Start Slide Show to view slide show and PowerPoint Web App will open a new Window to show the presentation.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App.png"><img class="alignnone size-medium wp-image-41" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App-300x158.png" alt="PowerPoint_Web_App" width="300" height="158" /></a></p>
<p>PowerPoint Web App also provides an Outline View to view the presentation as a text-only outline, just select File -&gt; Outline View.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_File_Menu.png"><img class="alignnone size-full wp-image-42" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_File_Menu.png" alt="PowerPoint_Web_App_File_Menu" width="252" height="298" /></a></p>
<p>The editing features of PowerPoint Web App are relatively rich. It supports create, duplicate, hide slide, insert picture, SmartArt or link (however, picture or SmartArt could only be added to the slide with picture or SmartArt layout). Also you can apply basic text or paragraph formatting.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_Editing_Feature.png"><img class="alignnone size-medium wp-image-43" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_Editing_Feature-300x170.png" alt="PowerPoint_Web_App_Editing_Feature" width="300" height="170" /></a></p>
<p>PowerPoint Web App also allows you to switch between several view modes. Click View tab and here you can select Editing View, Reading View or Slide Show.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_Presentation_View.png"><img class="alignnone size-full wp-image-44" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_Presentation_View.png" alt="PowerPoint_Web_App_Presentation_View" width="215" height="181" /></a></p>
<p>To add a new slide, click New Slide link from the Home group, there are nine slide layout available.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_New_Slide.png"><img class="alignnone size-medium wp-image-45" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_New_Slide-300x292.png" alt="PowerPoint_Web_App_New_Slide" width="300" height="292" /></a></p>
<p>You can change the picture style via the similar Picture Tools, there are 28 picture styles totally.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_Picture_Tools.png"><img class="alignnone size-medium wp-image-46" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_Picture_Tools-300x97.png" alt="PowerPoint_Web_App_Picture_Tools" width="300" height="97" /></a></p>
<p>The SmartArt Tools is also a wonderful feature. You can change layouts, text, or color scheme of your SmartArt graphics.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_SmartArt_Tools.png"><img class="alignnone size-medium wp-image-47" src="http://blog.fanhow.com/wp-content/uploads/2009/10/PowerPoint_Web_App_SmartArt_Tools-300x72.png" alt="PowerPoint_Web_App_SmartArt_Tools" width="300" height="72" /></a></p>
<p>Be attention, in PowerPoint Web App, there is no save button because your presentation is being saved automatically.</p>
<p><strong>Excel Web App</strong><br />
In view mode, you can find, download copy/snapshot and basic filter.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Excel_Web_App.png"><img class="alignnone size-medium wp-image-48" src="http://blog.fanhow.com/wp-content/uploads/2009/10/Excel_Web_App-300x197.png" alt="Excel_Web_App" width="300" height="197" /></a></p>
<p>Click Edit to switch to editing mode. Excel Web App does not support editing files in this format (XLS). To convert this workbook to a supported format, open the workbook for viewing and select Save a Copy from the Office button.<br />
You can add functions, table and link in the Excel Web App editor. Number formatting is very handily to apply. However, chart is not available in current Excel Web App.</p>
<p>Excel Web App is the only application in Office Web Apps that supports document collaboration. All the changes will be shown synchronously and you could check who are editing the document from the editing mode.<br />
<a href="http://blog.fanhow.com/wp-content/uploads/2009/10/Excel_Web_App_Editing.png"><img class="alignnone size-medium wp-image-49" src="http://blog.fanhow.com/wp-content/uploads/2009/10/Excel_Web_App_Editing-300x197.png" alt="Excel_Web_App_Editing" width="300" height="197" /></a></p>
<p><strong>OneNote Web App</strong><br />
OneNote Web App is not currently available. But it may be a revolution in the information gathering area. I myself is very look forward to the OneNote Web App.</p>
<p><a href="http://blog.fanhow.com/wp-content/uploads/2009/10/OneNote_Web_App.png"><img class="alignnone size-medium wp-image-50" src="http://blog.fanhow.com/wp-content/uploads/2009/10/OneNote_Web_App-300x176.png" alt="OneNote_Web_App" width="300" height="176" /></a></p>
<p><strong>Conclusion</strong><br />
Office Web Apps are cloud document sharing &amp; collaboration services and let multiple users access or edit office documents online. Office Web Apps is unquestionable a strong catalyst on the Cloud Office. For example, Google Docs has enabled user to <a href="http://news.cnet.com/8301-27076_3-10373211-248.html">share entire folders</a> recently in order to response to Office Web Apps’ more flexible sharing policies. Interfaces are a great advantage. Office Web Apps has a long way to go; however, as the <a href="http://www.chicagotribune.com/business/columnists/chi-mon-burns-microsoft-1012-oct12,0,3048264.column">cloud computing will burst with growth</a>, Office Web Apps get an opportunity to grow up. And finally, you’d better <a href="http://r.office.microsoft.com/r/rlidWebOfficeSilverlight">install Microsoft Silverlight</a> to make documents load faster and text looks clearer.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fanhow.com/2009/10/experience-of-the-microsoft-office-web-apps-strong-catalyst-on-cloud-office/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

