<?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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Do you know the data type?</title>
	<atom:link href="http://smurfonspreadsheets.wordpress.com/2008/05/06/do-you-know-the-data-type/feed/" rel="self" type="application/rss+xml" />
	<link>http://smurfonspreadsheets.wordpress.com/2008/05/06/do-you-know-the-data-type/</link>
	<description>Simon Murphy on professional spreadsheet development stuff</description>
	<pubDate>Wed, 09 Jul 2008 16:49:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: JP</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/05/06/do-you-know-the-data-type/#comment-11372</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Thu, 08 May 2008 10:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=584#comment-11372</guid>
		<description>Simon,

It depends on the sub. Some code has a specific purpose, so the users understand (or can be easily trained) to provide the proper inputs. But on some level you still need to check you aren't doing math with strings, for example. You never know when someone is going to try something new with your code that it isn't intended for.

Thx,
JP</description>
		<content:encoded><![CDATA[<p>Simon,</p>
<p>It depends on the sub. Some code has a specific purpose, so the users understand (or can be easily trained) to provide the proper inputs. But on some level you still need to check you aren&#8217;t doing math with strings, for example. You never know when someone is going to try something new with your code that it isn&#8217;t intended for.</p>
<p>Thx,<br />
JP</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Nordberg</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/05/06/do-you-know-the-data-type/#comment-11360</link>
		<dc:creator>Johan Nordberg</dc:creator>
		<pubDate>Tue, 06 May 2008 06:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=584#comment-11360</guid>
		<description>I never ever trust the user. 

But I guess it depends on where the data is going. Lately I've done alot of projects where Excel is the GUI, but data is read from and saved back to a database. Since I wouldn't dream of having a database without proper types, type checking becomes important. 

I try to use the Data, Validation feature to catch the error as early as possible. I also check the type before I save it to the database.

For type checking I use IsNumber, IsDate etc, TypeName and last On Error Resume Next : intValue = CInt(varValue). 

But as always you make decisions depending on the project.</description>
		<content:encoded><![CDATA[<p>I never ever trust the user. </p>
<p>But I guess it depends on where the data is going. Lately I&#8217;ve done alot of projects where Excel is the GUI, but data is read from and saved back to a database. Since I wouldn&#8217;t dream of having a database without proper types, type checking becomes important. </p>
<p>I try to use the Data, Validation feature to catch the error as early as possible. I also check the type before I save it to the database.</p>
<p>For type checking I use IsNumber, IsDate etc, TypeName and last On Error Resume Next : intValue = CInt(varValue). </p>
<p>But as always you make decisions depending on the project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonpeltier</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/05/06/do-you-know-the-data-type/#comment-11359</link>
		<dc:creator>jonpeltier</dc:creator>
		<pubDate>Tue, 06 May 2008 04:15:36 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=584#comment-11359</guid>
		<description>In other words:

I never assume a user puts a value of a particular type into a cell.</description>
		<content:encoded><![CDATA[<p>In other words:</p>
<p>I never assume a user puts a value of a particular type into a cell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harlan Grove</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/05/06/do-you-know-the-data-type/#comment-11357</link>
		<dc:creator>Harlan Grove</dc:creator>
		<pubDate>Tue, 06 May 2008 00:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=584#comment-11357</guid>
		<description>So what's the harm reading a range's .Value (if you need to distinguish dates from other numbers) or .Value2 (if you don't need to distinguish dates) into an array of variants? Execution speed working with variants rather than doubles or strings? Still load ranges into arrays of variants, then loop through the array of variants assigning values to arrays of doubles or strings as needed. It's faster in VBA to process a VBA array of variants than to loop through the range a cell at a time loading doubles or strings into like-typed arrays.

I never assume any cell contains a value of a particular type.</description>
		<content:encoded><![CDATA[<p>So what&#8217;s the harm reading a range&#8217;s .Value (if you need to distinguish dates from other numbers) or .Value2 (if you don&#8217;t need to distinguish dates) into an array of variants? Execution speed working with variants rather than doubles or strings? Still load ranges into arrays of variants, then loop through the array of variants assigning values to arrays of doubles or strings as needed. It&#8217;s faster in VBA to process a VBA array of variants than to loop through the range a cell at a time loading doubles or strings into like-typed arrays.</p>
<p>I never assume any cell contains a value of a particular type.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
