<?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: Convert Numbers to Military Times in Excel</title>
	<atom:link href="http://datapigtechnologies.com/blog/index.php/121/feed/" rel="self" type="application/rss+xml" />
	<link>http://datapigtechnologies.com/blog/index.php/121/</link>
	<description>A DataPig Technologies Blog</description>
	<lastBuildDate>Wed, 08 Feb 2012 00:53:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://datapigtechnologies.com/blog/index.php/121/comment-page-1/#comment-25280</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Tue, 20 Dec 2011 09:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=121#comment-25280</guid>
		<description>@Jimmy,

Try replacing all the quote marks... all of them, not just the ones on that line of code... this blog comment processor changes &quot;normal&quot; quote marks to opening/closing ones (notice that they are slanted instead of being straight up and down when you copy/paste the code). I think the code will run for you after you make that replacement.</description>
		<content:encoded><![CDATA[<p>@Jimmy,</p>
<p>Try replacing all the quote marks&#8230; all of them, not just the ones on that line of code&#8230; this blog comment processor changes &#8220;normal&#8221; quote marks to opening/closing ones (notice that they are slanted instead of being straight up and down when you copy/paste the code). I think the code will run for you after you make that replacement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy</title>
		<link>http://datapigtechnologies.com/blog/index.php/121/comment-page-1/#comment-25170</link>
		<dc:creator>Jimmy</dc:creator>
		<pubDate>Fri, 16 Dec 2011 15:55:46 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=121#comment-25170</guid>
		<description>I received a compile error, when i placed this code in excel. it was on the Const TimeRange As String = “D:G” . It stated Constant expression required and had D highlighted. Any suggestions?</description>
		<content:encoded><![CDATA[<p>I received a compile error, when i placed this code in excel. it was on the Const TimeRange As String = “D:G” . It stated Constant expression required and had D highlighted. Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://datapigtechnologies.com/blog/index.php/121/comment-page-1/#comment-7298</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Thu, 02 Dec 2010 16:43:38 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=121#comment-7298</guid>
		<description>I realize I&#039;m late to this thread, but here is a VB solution I posted to the newsgroups a couple of years ago or so. It will allow you to enter the time in many different ways. For example, you can enter 3p, 3:00, 934, 1723, 1234p, and so on; in other words, if it is missing the colon, the colon will be inserted and then, if the entry can be made into a date at all, it will be, otherwise an error message will be issued. The following is event code and should be installed by right clicking the name tab at the bottom of the worksheet that is to have this functionality, select View Code from the popup menu that appears and then copy/paste this code into the code window that opened up...

Private Sub Worksheet_Change(ByVal Target As Range)
  Dim T As String
  Const TimeRange As String = &quot;D:G&quot;
  If Target.Count &gt; 1 Then Exit Sub
  With Target
    If Not Intersect(Target, Range(TimeRange)) Is Nothing Then
      On Error GoTo CleanUp
      Application.EnableEvents = False
      T = .Value
      If T Like &quot;*[aApP]&quot; Then
        T = Replace(T, &quot;a&quot;, &quot; AM&quot;, , , vbTextCompare)
        T = Replace(T, &quot;p&quot;, &quot; PM&quot;, , , vbTextCompare)
      ElseIf T Like &quot;*[AaPp][mM]&quot; Then
        T = Left(T, Len(T) - 2) &amp; &quot; &quot; &amp; Right(T, 2)
      End If
      If Not IsDate(T) And InStr(T, &quot;:&quot;) = 0 And Len(T) &gt; 1 Then
        T = Left(T, InStr(T &amp; &quot; &quot;, &quot; &quot;) - 3) &amp; &quot;:&quot; &amp; _
             Mid(T, InStr(T &amp; &quot; &quot;, &quot; &quot;) - 2)
      End If
      T = WorksheetFunction.Trim(T)
      If IsDate(T) Then
        .Value = CDate(T)
      Else
        MsgBox &quot;That is not a real time value!&quot;
      End If
    End If
  End With
CleanUp:
  Application.EnableEvents = True
End Sub

All you need to do is set the TimeRange constant in the Const statement to the range you want to cover. In my example code above, I set that value to &quot;D:G&quot; which means columns D through G are set to convert entries into time values; but you can use any valid range address instead (for example, &quot;C4:F9&quot;) in order to restrict the code&#039;s functionality to just the cells in that restricted range.</description>
		<content:encoded><![CDATA[<p>I realize I&#8217;m late to this thread, but here is a VB solution I posted to the newsgroups a couple of years ago or so. It will allow you to enter the time in many different ways. For example, you can enter 3p, 3:00, 934, 1723, 1234p, and so on; in other words, if it is missing the colon, the colon will be inserted and then, if the entry can be made into a date at all, it will be, otherwise an error message will be issued. The following is event code and should be installed by right clicking the name tab at the bottom of the worksheet that is to have this functionality, select View Code from the popup menu that appears and then copy/paste this code into the code window that opened up&#8230;</p>
<p>Private Sub Worksheet_Change(ByVal Target As Range)<br />
  Dim T As String<br />
  Const TimeRange As String = &#8220;D:G&#8221;<br />
  If Target.Count &gt; 1 Then Exit Sub<br />
  With Target<br />
    If Not Intersect(Target, Range(TimeRange)) Is Nothing Then<br />
      On Error GoTo CleanUp<br />
      Application.EnableEvents = False<br />
      T = .Value<br />
      If T Like &#8220;*[aApP]&#8221; Then<br />
        T = Replace(T, &#8220;a&#8221;, &#8221; AM&#8221;, , , vbTextCompare)<br />
        T = Replace(T, &#8220;p&#8221;, &#8221; PM&#8221;, , , vbTextCompare)<br />
      ElseIf T Like &#8220;*[AaPp][mM]&#8221; Then<br />
        T = Left(T, Len(T) &#8211; 2) &amp; &#8221; &#8221; &amp; Right(T, 2)<br />
      End If<br />
      If Not IsDate(T) And InStr(T, &#8220;:&#8221;) = 0 And Len(T) &gt; 1 Then<br />
        T = Left(T, InStr(T &amp; &#8221; &#8220;, &#8221; &#8220;) &#8211; 3) &amp; &#8220;:&#8221; &amp; _<br />
             Mid(T, InStr(T &amp; &#8221; &#8220;, &#8221; &#8220;) &#8211; 2)<br />
      End If<br />
      T = WorksheetFunction.Trim(T)<br />
      If IsDate(T) Then<br />
        .Value = CDate(T)<br />
      Else<br />
        MsgBox &#8220;That is not a real time value!&#8221;<br />
      End If<br />
    End If<br />
  End With<br />
CleanUp:<br />
  Application.EnableEvents = True<br />
End Sub</p>
<p>All you need to do is set the TimeRange constant in the Const statement to the range you want to cover. In my example code above, I set that value to &#8220;D:G&#8221; which means columns D through G are set to convert entries into time values; but you can use any valid range address instead (for example, &#8220;C4:F9&#8243;) in order to restrict the code&#8217;s functionality to just the cells in that restricted range.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sébastien Labonne</title>
		<link>http://datapigtechnologies.com/blog/index.php/121/comment-page-1/#comment-111</link>
		<dc:creator>Sébastien Labonne</dc:creator>
		<pubDate>Thu, 18 Jun 2009 17:42:17 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=121#comment-111</guid>
		<description>I think I might know why. Do you have integer in the cell or fractions?</description>
		<content:encoded><![CDATA[<p>I think I might know why. Do you have integer in the cell or fractions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DataPig</title>
		<link>http://datapigtechnologies.com/blog/index.php/121/comment-page-1/#comment-110</link>
		<dc:creator>DataPig</dc:creator>
		<pubDate>Thu, 18 Jun 2009 16:20:32 +0000</pubDate>
		<guid isPermaLink="false">http://datapigtechnologies.com/blog/?p=121#comment-110</guid>
		<description>That is odd.  Thanks for the link. I&#039;ll take a look.</description>
		<content:encoded><![CDATA[<p>That is odd.  Thanks for the link. I&#8217;ll take a look.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

