<?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>Tiposaurus &#187; VBA / Excel</title>
	<atom:link href="http://www.tiposaurus.co.uk/category/vba-excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tiposaurus.co.uk</link>
	<description>Web Development and Web Hosting Tutorials</description>
	<lastBuildDate>Wed, 02 May 2012 20:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Excel Tip: Evaluate part of a formula directly in the formula bar</title>
		<link>http://www.tiposaurus.co.uk/2011/05/27/excel-tip-evaluate-part-of-a-formula-directly-in-the-formula-bar/</link>
		<comments>http://www.tiposaurus.co.uk/2011/05/27/excel-tip-evaluate-part-of-a-formula-directly-in-the-formula-bar/#comments</comments>
		<pubDate>Fri, 27 May 2011 19:11:11 +0000</pubDate>
		<dc:creator>Tiposaurus</dc:creator>
				<category><![CDATA[VBA / Excel]]></category>

		<guid isPermaLink="false">http://tiposaurus.co.uk/?p=145</guid>
		<description><![CDATA[Quite an unassuming tip today, but potentially useful (and not immediately obvious). In Excel, if you have a complex formula within a cell, you can immediately evaulate part of it by selecting the part (dragging across it with the mouse or by using arrow keys), then press F9. For example, if you have: =cos(3+2/5) then [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start -->
<p>Quite an unassuming tip today, but potentially useful (and not immediately obvious).</p>
<div>In Excel, if you have a complex formula within a cell, you can immediately evaulate part of it by selecting the part (dragging across it with the mouse or by using arrow keys), then press F9.</div>
<div>For example, if you have:</div>
<div><span style="font-family: 'courier new';">=cos(3+2/5)</span></div>
<div>then you select the <span style="font-family: 'courier new';">3+2/5</span> part:</div>
<div><span style="font-family: 'courier new';">=cos(<span style="color: #ffffff; background-color: #0000ff;">3+2/5</span>)</span></div>
<div>and press F9:</div>
<div><span style="font-family: 'courier new';">=cos(3.4)</span></div>
<div>This is useful for simplifying formulae, and also diagnosis when something isn't working as expected.  Note that if you press enter (or click on another cell), it will save the formula with the evaluated number in the cell, rather than the original one.  To avoid saving it, press Escape when you're done editing.</div>
<div>So for the above example, enter saves the formula <span style="font-family: 'courier new';">=cos(3.4)</span> in the cell, while pressing escape returns it to <span style="font-family: 'courier new';">=cos(3+2/5)</span>.</div>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.tiposaurus.co.uk/2011/05/27/excel-tip-evaluate-part-of-a-formula-directly-in-the-formula-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Get the Weekday as Text in Excel VBA</title>
		<link>http://www.tiposaurus.co.uk/2009/06/10/how-to-get-the-weekday-as-text-in-excel-vba/</link>
		<comments>http://www.tiposaurus.co.uk/2009/06/10/how-to-get-the-weekday-as-text-in-excel-vba/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:38:53 +0000</pubDate>
		<dc:creator>Tiposaurus</dc:creator>
				<category><![CDATA[VBA / Excel]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[weekday]]></category>

		<guid isPermaLink="false">http://tiposaurus.co.uk/2009/06/how-to-get-the-weekday-as-text-in-excel-vba/</guid>
		<description><![CDATA[I often want to know what day of the week a date is. Excel has a function for this, but unfortunately it only returns an integer, for example the function: =WEEKDAY("01/02/2009") returns 1 (which represents Sunday). This can be a bit confusing with a list of dates, so I wrote the following quick VBA function [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start -->
<p>I often want to know what day of the week a date is. Excel has a function for this, but unfortunately it only returns an integer, for example the function:<br />
<code>=WEEKDAY("01/02/2009")</code><br />
returns 1 (which represents Sunday).</p>
<p>This can be a bit confusing with a list of dates, so I wrote the following quick VBA function to get the day of the week as text, e.g. Sunday, Monday, etc.</p>
<p>The function (possibly not the most elegant method possible) is:</p>
<pre><code>' function to return a text representation of the weekday of a given date
' returns the full text, which can be shortened by left(), etc
Function dayText(d As Date) As String
If Weekday(d) = 1 Then dayText = "Sunday"
If Weekday(d) = 2 Then dayText = "Monday"
If Weekday(d) = 3 Then dayText = "Tuesday"
If Weekday(d) = 4 Then dayText = "Wednesday"
If Weekday(d) = 5 Then dayText = "Thursday"
If Weekday(d) = 6 Then dayText = "Friday"
If Weekday(d) = 7 Then dayText = "Saturday"
End Function</code></pre>
<p>(Enter this via the VBA Editor - press Alt+F11, then insert -&gt; module and paste this code in).</p>
<p>It can then be called by:<br />
<code>=DAYTEXT("01/02/2009")</code><br />
which returns Sunday.</p>
<p>This can then be shortened to one or three letters via the left() function, for example:<br />
<code>=LEFT(DAYTEXT("01/02/2009"),3)</code><br />
returns Sun.</p>
<p>If you want to avoid macros, an alternative method is to use the (slightly messy) formula consisting of nested IFs, for a spreadsheet with a date in cell A1:<br />
<code>=IF(WEEKDAY(A1)=1, "Sunday", IF(WEEKDAY(A1)=2,"Monday",IF(WEEKDAY(A1)=3, "Tuesday", IF(WEEKDAY(A1)=4, "Wednesday", IF(WEEKDAY(A1)=5, "Thursday", IF(WEEKDAY(A1)=6, "Friday", "Saturday"))))))</code></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.tiposaurus.co.uk/2009/06/10/how-to-get-the-weekday-as-text-in-excel-vba/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

