﻿<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 3 applications of Data Validation in a Project Finance model</title>
	<atom:link href="http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/</link>
	<description>Financial Modelling Experts sharing their knowledge</description>
	<lastBuildDate>Thu, 08 Jul 2010 20:23:15 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jon von der Heyden</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-157</link>
		<dc:creator>Jon von der Heyden</dc:creator>
		<pubDate>Tue, 03 Nov 2009 12:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-157</guid>
		<description>Chris

I do tend to keep sheets dedicated to validation lists.  But creating an additional dependency (i.e., write output to another hidden range) is an unnecessary dependency and makes tracking just that little more complex.  I like a &#039;keep it simple&#039; approach and therefore I would not use a combobox as a substitute to list validation unless I specifically wanted to employ a VBA procedure to trigger based on the user selection.  

Although I avoid worksheet controls as much as possible, especiallly ActiveX controls which are prone to various bugs.  Regardless of the type each control has a cololection of its&#039; own properties each of which needs consideration and adds that little extra unnecessary complexity.  Instead if there is any genuine value offered by a control (list / combobox etc) I tend to use forms or toolbar controls.

In short, my view is to use Excels native in-built features and only ever consider more complex solutions such as controls / VBA if I think it will offer significant improvement.  This is not true in this instance since I have already suggested different appoaches to avoiding validation overwrite.</description>
		<content:encoded><![CDATA[<p>Chris</p>
<p>I do tend to keep sheets dedicated to validation lists.  But creating an additional dependency (i.e., write output to another hidden range) is an unnecessary dependency and makes tracking just that little more complex.  I like a &#8216;keep it simple&#8217; approach and therefore I would not use a combobox as a substitute to list validation unless I specifically wanted to employ a VBA procedure to trigger based on the user selection.  </p>
<p>Although I avoid worksheet controls as much as possible, especiallly ActiveX controls which are prone to various bugs.  Regardless of the type each control has a cololection of its&#8217; own properties each of which needs consideration and adds that little extra unnecessary complexity.  Instead if there is any genuine value offered by a control (list / combobox etc) I tend to use forms or toolbar controls.</p>
<p>In short, my view is to use Excels native in-built features and only ever consider more complex solutions such as controls / VBA if I think it will offer significant improvement.  This is not true in this instance since I have already suggested different appoaches to avoiding validation overwrite.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris McNeill</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-155</link>
		<dc:creator>Chris McNeill</dc:creator>
		<pubDate>Mon, 02 Nov 2009 23:49:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-155</guid>
		<description>@ Jon
Shouldn&#039;t be too prone to overwrite if you call the box contents (ListFillRange or Input Range) from a range name in a hidden sheet, and write the result (LinkedCell or Cell link) to a range name in a hidden sheet...should avoid unwanted interaction, be that copy/paste etc.

Also it&#039;s a no-code solution...</description>
		<content:encoded><![CDATA[<p>@ Jon<br />
Shouldn&#8217;t be too prone to overwrite if you call the box contents (ListFillRange or Input Range) from a range name in a hidden sheet, and write the result (LinkedCell or Cell link) to a range name in a hidden sheet&#8230;should avoid unwanted interaction, be that copy/paste etc.</p>
<p>Also it&#8217;s a no-code solution&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon von der Heyden</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-152</link>
		<dc:creator>Jon von der Heyden</dc:creator>
		<pubDate>Mon, 02 Nov 2009 09:17:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-152</guid>
		<description>@ Chris

Using a combo / listbox assumes that you are only attempting to prevent a user from overwriting a list validation.  And configuring a combo / listbox inevitably means that you must write the selection to a cell anyway so it is prone to overwrite too.

@ Nick

Speed certainly isn&#039;t an isse with regards to my first suggestion.  A simple change event that cancels CutCopy is incredibly quick and it doesn&#039;t trigger a recalc or anything.  Point taken about it being annoying -  but did you read the article from VBAX that shows how to disable the controls?  This could easily be tailored to rstrict paste over validation cells.</description>
		<content:encoded><![CDATA[<p>@ Chris</p>
<p>Using a combo / listbox assumes that you are only attempting to prevent a user from overwriting a list validation.  And configuring a combo / listbox inevitably means that you must write the selection to a cell anyway so it is prone to overwrite too.</p>
<p>@ Nick</p>
<p>Speed certainly isn&#8217;t an isse with regards to my first suggestion.  A simple change event that cancels CutCopy is incredibly quick and it doesn&#8217;t trigger a recalc or anything.  Point taken about it being annoying &#8211;  but did you read the article from VBAX that shows how to disable the controls?  This could easily be tailored to rstrict paste over validation cells.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris McNeill</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-141</link>
		<dc:creator>Chris McNeill</dc:creator>
		<pubDate>Fri, 30 Oct 2009 10:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-141</guid>
		<description>Nick,

Couldn&#039;t get a stable result from the VBA code...seemed to enter an eternal loop when copying and pasting to a non-validation cell. Do you encounter same?

My first thought was along Jon&#039;s lines of setting the Application.CutCopyMode to false to scrub the copying - but I take your point about accidental selection.

The other option would be to use a Combobox on the sheet, and do away with the data validation cell altogether

Chris.</description>
		<content:encoded><![CDATA[<p>Nick,</p>
<p>Couldn&#8217;t get a stable result from the VBA code&#8230;seemed to enter an eternal loop when copying and pasting to a non-validation cell. Do you encounter same?</p>
<p>My first thought was along Jon&#8217;s lines of setting the Application.CutCopyMode to false to scrub the copying &#8211; but I take your point about accidental selection.</p>
<p>The other option would be to use a Combobox on the sheet, and do away with the data validation cell altogether</p>
<p>Chris.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Crawley</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-121</link>
		<dc:creator>Nick Crawley</dc:creator>
		<pubDate>Mon, 26 Oct 2009 05:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-121</guid>
		<description>Hi all,

I tried Jon&#039;s method and experienced a few glitches, maybe you could check them out for me. The problem I encountered was that

1.The way that the code works means that if I were to copy a cell (Ctrl – C and get the dotted line box around the cell), and accidentally moved my cursor into a data validation cell, I can no longer &quot;paste&quot;, which means that every time I select a cell with data validation, Excel seemed to lose its memory of the cell that I was suppose to copy/paste.

2. The method means that every time your selection changes, the macro will be run (could potentially lead to speed problems and seems over-engineered unless this functionality was mission critical).

Suggestions: 
1. Protect the cells the usual way with data validation. 

Tools -&gt; Protection -&gt; Allow Users to Edit Ranges -&gt; Select the cells with data validations 

2. Format the data validation cell to be protected, using 

Tools -&gt; Protection -&gt; Protect Sheet -&gt; Password Optional -&gt; OK
The data validation ability of the cell will be retained even after copy paste.

Or as a suggestion in VBA, in the code module for the worksheet that you have your data validation in, use the code below, this will undo the action if you have pasted on a data validation cell. I am sorry I have not annotated it very well !


Private Sub Worksheet_Change(ByVal Target As Range)
    &#039;Does the validation range still have validation?
    If HasValidation(Range(Target.Address)) Then
        Exit Sub
    Else
        Application.Undo
        MsgBox &quot;Your last operation was canceled.&quot; &amp; _
        &quot;It would have deleted data validation rules.&quot;, vbCritical
    End If
End Sub

Private Function HasValidation(r) As Boolean
&#039;   Returns True if every cell in Range r uses Data Validation
    On Error Resume Next
    x = r.Validation.Type
    If Err.Number = 0 Then HasValidation = True Else HasValidation = False
End Function</description>
		<content:encoded><![CDATA[<p>Hi all,</p>
<p>I tried Jon&#8217;s method and experienced a few glitches, maybe you could check them out for me. The problem I encountered was that</p>
<p>1.The way that the code works means that if I were to copy a cell (Ctrl – C and get the dotted line box around the cell), and accidentally moved my cursor into a data validation cell, I can no longer &#8220;paste&#8221;, which means that every time I select a cell with data validation, Excel seemed to lose its memory of the cell that I was suppose to copy/paste.</p>
<p>2. The method means that every time your selection changes, the macro will be run (could potentially lead to speed problems and seems over-engineered unless this functionality was mission critical).</p>
<p>Suggestions:<br />
1. Protect the cells the usual way with data validation. </p>
<p>Tools -&gt; Protection -&gt; Allow Users to Edit Ranges -&gt; Select the cells with data validations </p>
<p>2. Format the data validation cell to be protected, using </p>
<p>Tools -&gt; Protection -&gt; Protect Sheet -&gt; Password Optional -&gt; OK<br />
The data validation ability of the cell will be retained even after copy paste.</p>
<p>Or as a suggestion in VBA, in the code module for the worksheet that you have your data validation in, use the code below, this will undo the action if you have pasted on a data validation cell. I am sorry I have not annotated it very well !</p>
<p>Private Sub Worksheet_Change(ByVal Target As Range)<br />
    &#8216;Does the validation range still have validation?<br />
    If HasValidation(Range(Target.Address)) Then<br />
        Exit Sub<br />
    Else<br />
        Application.Undo<br />
        MsgBox &#8220;Your last operation was canceled.&#8221; &amp; _<br />
        &#8220;It would have deleted data validation rules.&#8221;, vbCritical<br />
    End If<br />
End Sub</p>
<p>Private Function HasValidation(r) As Boolean<br />
&#8216;   Returns True if every cell in Range r uses Data Validation<br />
    On Error Resume Next<br />
    x = r.Validation.Type<br />
    If Err.Number = 0 Then HasValidation = True Else HasValidation = False<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon von der Heyden</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-78</link>
		<dc:creator>Jon von der Heyden</dc:creator>
		<pubDate>Mon, 19 Oct 2009 08:24:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-78</guid>
		<description>Hi Rickard

I thought it may be useful; to validate that a cell only houses a date that is equal to the last daye of the month, use the following formula in validation type custom:
=A1=DATE(YEAR(A1),MONTH(A1)+1,0)

Regards
Jon</description>
		<content:encoded><![CDATA[<p>Hi Rickard</p>
<p>I thought it may be useful; to validate that a cell only houses a date that is equal to the last daye of the month, use the following formula in validation type custom:<br />
=A1=DATE(YEAR(A1),MONTH(A1)+1,0)</p>
<p>Regards<br />
Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon von der Heyden</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-77</link>
		<dc:creator>Jon von der Heyden</dc:creator>
		<pubDate>Mon, 19 Oct 2009 08:17:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-77</guid>
		<description>Further, I use the sheet change event regularly in my models.  It is a common problem for me and I much prefer this method.  I have seen some modellers go to extremes by using a complete VBA approach as a substitute to validation.   But in my view native validation is so powerful and very easy to set-up (for a developer).  Restricting paste over validation is achieved with 7 lines of code attached to the sheet module.  You can also attach to the ThisWorkbook module if you want it true on all sheets.  You would then use the Workbook_SheetChange event:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    On Error GoTo Finish
        If Target.Validation.Type Then
            Application.CutCopyMode = False
        End If
Finish:
End Sub

I&#039;m not either a big fan of disabling the controls.  I do disable controls and build custom controls in my models but then I am very cautious of how I do it.  If you don&#039;t get it right then you run the risk of having the controls disabled when the user switches to other workbooks too.</description>
		<content:encoded><![CDATA[<p>Further, I use the sheet change event regularly in my models.  It is a common problem for me and I much prefer this method.  I have seen some modellers go to extremes by using a complete VBA approach as a substitute to validation.   But in my view native validation is so powerful and very easy to set-up (for a developer).  Restricting paste over validation is achieved with 7 lines of code attached to the sheet module.  You can also attach to the ThisWorkbook module if you want it true on all sheets.  You would then use the Workbook_SheetChange event:</p>
<p>Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)<br />
    On Error GoTo Finish<br />
        If Target.Validation.Type Then<br />
            Application.CutCopyMode = False<br />
        End If<br />
Finish:<br />
End Sub</p>
<p>I&#8217;m not either a big fan of disabling the controls.  I do disable controls and build custom controls in my models but then I am very cautious of how I do it.  If you don&#8217;t get it right then you run the risk of having the controls disabled when the user switches to other workbooks too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon von der Heyden</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-76</link>
		<dc:creator>Jon von der Heyden</dc:creator>
		<pubDate>Mon, 19 Oct 2009 08:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-76</guid>
		<description>Hello Danielle

You will need to employ VBA in your model to prohibit copy and paste.  A general a simple method will be to exit CutCopy mode each time a selection changes in a sheet.  The following will need to be pasted into the relevant sheet module:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.CutCopyMode = False
End Sub

To prohibit copy and paste over a validation cell:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    On Error GoTo Finish
        If Target.Validation.Type Then
            Application.CutCopyMode = False
        End If
Finish:
End Sub

Or see this article if you want to disable all copy and paste controls and shortcuts:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=373</description>
		<content:encoded><![CDATA[<p>Hello Danielle</p>
<p>You will need to employ VBA in your model to prohibit copy and paste.  A general a simple method will be to exit CutCopy mode each time a selection changes in a sheet.  The following will need to be pasted into the relevant sheet module:</p>
<p>Private Sub Worksheet_SelectionChange(ByVal Target As Range)<br />
    Application.CutCopyMode = False<br />
End Sub</p>
<p>To prohibit copy and paste over a validation cell:</p>
<p>Private Sub Worksheet_SelectionChange(ByVal Target As Range)<br />
    On Error GoTo Finish<br />
        If Target.Validation.Type Then<br />
            Application.CutCopyMode = False<br />
        End If<br />
Finish:<br />
End Sub</p>
<p>Or see this article if you want to disable all copy and paste controls and shortcuts:</p>
<p><a href="http://www.vbaexpress.com/kb/getarticle.php?kb_id=373" rel="nofollow">http://www.vbaexpress.com/kb/getarticle.php?kb_id=373</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Crawley</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-70</link>
		<dc:creator>Nick Crawley</dc:creator>
		<pubDate>Sun, 18 Oct 2009 21:25:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-70</guid>
		<description>Hi Danielle,

I personally have not got a solution for completely restricting a users input into a cell, maybe Excel needs a Data Restriction functionality as well as Data Validation?! I would be surprised if this can&#039;t be performed with VBA and/or cell/sheet protection properties, but I am not sure the problem is worth the introduction of a script or a potentially convoluted protection set-up just for this. 

I guess this is another example of the difference between a financial model and &#039;software&#039; and highlights the need for models to incorporate some element of control but really reinforce messages to users through appropriate labelling and formatting when a value is allowed and when its not.

Having a user paste over a cell in this way isn&#039;t common experience for me (Navigator) although earlier this year we (Navigator) were engaged by a European avionics and aerospace engineering firm to construct a template model for their project teams for contract bidding. The model was to be used company wide and was lets say ‘comprehensive’, we located all data validated inputs in a ‘set-up’ sheet which was aside from the usual model inputs. So a user could still paste over a cell but it was visually and location wise, so obviously “only” a choice that the chances of this happening were at least minimised.

I would also be interested if there is a simple way to accomplish Data Restriction….

Nick</description>
		<content:encoded><![CDATA[<p>Hi Danielle,</p>
<p>I personally have not got a solution for completely restricting a users input into a cell, maybe Excel needs a Data Restriction functionality as well as Data Validation?! I would be surprised if this can&#8217;t be performed with VBA and/or cell/sheet protection properties, but I am not sure the problem is worth the introduction of a script or a potentially convoluted protection set-up just for this. </p>
<p>I guess this is another example of the difference between a financial model and &#8217;software&#8217; and highlights the need for models to incorporate some element of control but really reinforce messages to users through appropriate labelling and formatting when a value is allowed and when its not.</p>
<p>Having a user paste over a cell in this way isn&#8217;t common experience for me (Navigator) although earlier this year we (Navigator) were engaged by a European avionics and aerospace engineering firm to construct a template model for their project teams for contract bidding. The model was to be used company wide and was lets say ‘comprehensive’, we located all data validated inputs in a ‘set-up’ sheet which was aside from the usual model inputs. So a user could still paste over a cell but it was visually and location wise, so obviously “only” a choice that the chances of this happening were at least minimised.</p>
<p>I would also be interested if there is a simple way to accomplish Data Restriction….</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danielle Stein Fairhurst</title>
		<link>http://www.fimodo.com/2009/10/3-applications-of-data-validation-in-a-project-finance-model/comment-page-1/#comment-65</link>
		<dc:creator>Danielle Stein Fairhurst</dc:creator>
		<pubDate>Fri, 16 Oct 2009 11:20:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.fimodo.com/?p=511#comment-65</guid>
		<description>Hi Nick,

Thanks for a good overview of this really useful tool.  

I particularly like your comment at the end about excessive use. When users discover this feature they often get Data Validation Fever and start using it everywhere!

I wondered if anyone has been able to come up with a solution for the problem of users being able to paste invalid data straight into the cell?  It&#039;s frustrating when you have gone to all the trouble of creating a data validation to restrict what users can enter into a cell, and then it is quite easily for a user to copy and paste into the restricted cell, so bypassing the validation.

Regards,
Danielle Stein Fairhurst
Plum Solutions.</description>
		<content:encoded><![CDATA[<p>Hi Nick,</p>
<p>Thanks for a good overview of this really useful tool.  </p>
<p>I particularly like your comment at the end about excessive use. When users discover this feature they often get Data Validation Fever and start using it everywhere!</p>
<p>I wondered if anyone has been able to come up with a solution for the problem of users being able to paste invalid data straight into the cell?  It&#8217;s frustrating when you have gone to all the trouble of creating a data validation to restrict what users can enter into a cell, and then it is quite easily for a user to copy and paste into the restricted cell, so bypassing the validation.</p>
<p>Regards,<br />
Danielle Stein Fairhurst<br />
Plum Solutions.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
