<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Dansk Regneark Forum : Kode - Husk position</title>
  <link>https://forum.excel-regneark.dk/</link>
  <description><![CDATA[Dette er et XML Feed af; Dansk Regneark Forum : Makro og VBA : Kode - Husk position]]></description>
  <pubDate>Sat, 05 Dec 2026 13:23:45 +0000</pubDate>
  <lastBuildDate>Mon, 07 Jan 2019 17:10:24 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.08</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://forum.excel-regneark.dk/RSS_post_feed.asp?TID=3741</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Dansk Regneark Forum]]></title>
   <url>https://forum.excel-regneark.dk/css_styles/Excel-regneark.dk/logo.png</url>
   <link>https://forum.excel-regneark.dk/</link>
  </image>
  <item>
   <title><![CDATA[Kode - Husk position : Du har retDu skal skydes ved daggryTak...]]></title>
   <link>https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18496.html#18496</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=1125">Ib Hansen</a><br /><strong>Emne:</strong> 3741<br /><strong>Sendt:</strong> 07.Jan.2019 kl. 17:10<br /><br />Du har ret&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley31.gif" border="0" alt="Hug" title="Hug" /><div>Du skal skydes ved daggry&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley36.gif" border="0" alt="LOL" title="LOL" /></div><div><br></div><div>Tak for hjælpen</div>]]>
   </description>
   <pubDate>Mon, 07 Jan 2019 17:10:24 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18496.html#18496</guid>
  </item> 
  <item>
   <title><![CDATA[Kode - Husk position : Det er noget dobbelt, at benyt...]]></title>
   <link>https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18495.html#18495</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=732">EXCELGAARD</a><br /><strong>Emne:</strong> 3741<br /><strong>Sendt:</strong> 07.Jan.2019 kl. 15:53<br /><br />Det er noget dobbelt, at benytte...<table width="99%"><tr><td><pre class="BBcode">Range(Target.Address).Select</pre></td></tr></table>Du kan blot benytte:<table width="99%"><tr><td><pre class="BBcode">Target.Select</pre></td></tr></table><br>]]>
   </description>
   <pubDate>Mon, 07 Jan 2019 15:53:09 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18495.html#18495</guid>
  </item> 
  <item>
   <title><![CDATA[Kode - Husk position : Hej ExcelgaardJeg fandt selv l&#248;sningen,...]]></title>
   <link>https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18494.html#18494</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=1125">Ib Hansen</a><br /><strong>Emne:</strong> 3741<br /><strong>Sendt:</strong> 07.Jan.2019 kl. 15:14<br /><br />Hej Excelgaard<div><br></div><div><b>Jeg fandt selv løsningen, før jeg så dit svar</b>&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley17.gif" border="0" alt="T&#111;ngue" title="T&#111;ngue" /><img src="https://forum.excel-regneark.dk/smileys/smiley36.gif" border="0" alt="LOL" title="LOL" /></div><div>Men jeg kan desværre ikke selv markerer tråden som "Løst"&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley13.gif" border="0" alt="Disapprove" title="Disapprove" /></div><div><br><a href="uploads/1125/Løst_-_Klokkeslæts_kode.xlsm" target="_blank" rel="nofollow"><b><u>Test ark</u></b></a></div><div><br></div><div>Her er hele tidskoden, der er indsat i Sheets("Ark1").</div><div><b>Løsning med rødt.</b></div><div><table width="99%"><tr><td><pre class="BBcode">Private Sub Worksheet_Change(ByVal Target As Excel.Range)</div><div><b><font color="#009900">'----------------------------------------------------------------------------------</font></b></div><div><b><font color="#009900">'*' Tast klokkeslæt direkte i cellerne.</font></b></div><div><b><font color="#009900">'*' Kopier koden og indsæt den direkte under det ark den skal bruges.</font></b></div><div><b><font color="#009900">'*' I linje 3 nedenunder skal Sheets() og Range("") tilpasses.</font></b></div><div><b><font color="#009900">'*' Der kan tilføjes flere Range efter behov.</font></b></div><div><b><font color="#009900">'*' Brug komma som separator ved flere Range = Range("N9:P487, R9:S487, U9:V487").</font></b></div><div><b><font color="#009900">'*' Formater cellerne, hvor klokkeslættene skal tastes, som Klokkeslætsformat.</font></b></div><div><b><font color="#009900"><br></font></b></div><div><b><font color="#009900">'*' Se også det med grønt nederst i koden vedr. Password.</font></b></div><div><b><font color="#009900">'----------------------------------------------------------------------------------</font></b></div><div>&nbsp; &nbsp; On Error GoTo EndMacro</div><div>&nbsp; &nbsp; If Intersect(Target, Sheets("Forside").Range("D17:E398, G7:H398")) Is Nothing Then Exit Sub</div><div>&nbsp; &nbsp; If Target.Cells.Count &gt; 1 Then Exit Sub</div><div>&nbsp; &nbsp; If Target.Value = "" Then Exit Sub</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Application.EnableEvents = False</div><div>&nbsp; &nbsp; With Target</div><div>&nbsp; &nbsp; &nbsp; &nbsp; If .HasFormula = False Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Select Case Len(.Value)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case 1 ' e.g., 1 = 00:01 AM</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TimeStr = "00:0" &amp; .Value</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case 2 ' e.g., 12 = 00:12 AM</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TimeStr = "00:" &amp; .Value</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case 3 ' e.g., 735 = 7:35 AM</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TimeStr = Left(.Value, 1) &amp; ":" &amp; Right(.Value, 2)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case 4 ' e.g., 1234 = 12:34</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TimeStr = Left(.Value, 2) &amp; ":" &amp; Right(.Value, 2)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case 5 ' e.g., 12345 = 1:23:45 NOT 12:03:45</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TimeStr = Left(.Value, 1) &amp; ":" &amp; Mid(.Value, 2, 2) &amp; ":" &amp; Right(.Value, 2)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case 6 ' e.g., 123456 = 12:34:56</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TimeStr = Left(.Value, 2) &amp; ":" &amp; Mid(.Value, 3, 2) &amp; ":" &amp; Right(.Value, 2)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Case Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Err.Raise 0</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End Select</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.Value = TimeValue(TimeStr)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Application.EnableEvents = True</div><div>&nbsp; &nbsp; Exit Sub</div><div>&nbsp;</div><div>EndMacro:</div><div>&nbsp; &nbsp; &nbsp;On Error Resume Next</div><div><b><font color="#ff0000" size="2">&nbsp; &nbsp; &nbsp;Range(Target.Address).Select: Selection = ""</font></b></div><div><b><font color="#009900">&nbsp;'Dialog Message</font></b></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;QuestionToMessageBox = "&nbsp; &nbsp;Ugyldig indtastning !" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; vbNewLine &amp; "&nbsp; &nbsp;Der er enten brugt separator." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;Eller det er et ugyldigt klokkeslæt." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; vbNewLine &amp; "&nbsp; &nbsp;Skriv et korrekt klokkeslæt, som et helt tal, uden separator." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 1&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;00:01" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 12&nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;00:12" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 123&nbsp; &nbsp; =&nbsp; &nbsp;01:23" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 1234&nbsp; =&nbsp; &nbsp;12:34" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; vbNewLine &amp; "&nbsp; &nbsp;Midnat, klokken 24:00, skrives altid som 0." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 0&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;24:00"</div><div><b><font color="#009900">'MsgBox Title</font></b></div><div>&nbsp; &nbsp; &nbsp; &nbsp; YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbOKOnly + vbInformation, "")</div><div><br></div><div><b><font color="#009900">'----------------------------------------------------------------------------------</font></b></div><div><b><font color="#009900">'*' Hvis der bruges Password, skal Password skrives i koden nedenunder.</font></b></div><div><b><font color="#009900">'*' Password indsættes 2 steder.</font></b></div><div><b><font color="#009900">'*' 1) Hvor arket låses op.</font></b></div><div><b><font color="#009900">'*' 2) Hvor arket låses igen.</font></b></div><div><b><font color="#009900">'*' Eks hvis Password = Hej -&gt; ActiveSheet.Unprotect Password:="Hej"</font></b></div><div><b><font color="#009900">'*' Eks hvis Password = Hej -&gt; ActiveSheet.Protect Password:="Hej"</font></b></div><div><b><font color="#009900"><br></font></b></div><div><b><font color="#009900">'*' Hvis arket låses, men UDEN Password, skal der ikke ændres i koden.</font></b></div><div><b><font color="#009900">'*' Koden skal heller ikke ændres, hvis der IKKE bruges Password.</font></b></div><div><b><font color="#009900">'*' Her bruges bare tomme tegn.</font></b></div><div><b><font color="#009900">'*' Eks -&gt; ActiveSheet.Unprotect Password:=""</font></b></div><div><b><font color="#009900">'*' Eks -&gt; ActiveSheet.Protect Password:=""</font></b></div><div><b><font color="#009900">'----------------------------------------------------------------------------------</font></b></div><div>UD:</div><div><b><font color="#009900">Rem&nbsp; &nbsp; ActiveSheet.Unprotect Password:=Sheets("Indstillinger").Range("B9").Value</font></b></div><div><b><font color="#009900">Rem&nbsp; &nbsp; ActiveCell.NumberFormat = "hh:mm"</font></b></div><div><b><font color="#009900">Rem&nbsp; &nbsp; ActiveSheet.Protect Password:=Sheets("Indstillinger").Range("B9").Value</font></b></div><div>&nbsp; &nbsp; Application.EnableEvents = True</div><div>End Sub</div><div></pre></td></tr></table><br>Tak for indput&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley41.gif" border="0" alt="Beer" title="Beer" /></div><div><br></div><div>Mvh.</div><div>Ib</div>]]>
   </description>
   <pubDate>Mon, 07 Jan 2019 15:14:09 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18494.html#18494</guid>
  </item> 
  <item>
   <title><![CDATA[Kode - Husk position : Kom lige til at se...Vil det ikke...]]></title>
   <link>https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18493.html#18493</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=732">EXCELGAARD</a><br /><strong>Emne:</strong> 3741<br /><strong>Sendt:</strong> 07.Jan.2019 kl. 15:06<br /><br /><div>Kom lige til at se...</div><div><br></div><div>Vil det ikke være bedre, at benytte data validering til at teste for dette?</div><div>Og, dermed undgå for meget kode og for mange events?</div><div><br></div><div>Bare sæt data valideringen til et helt tal mellem 0 og 2400 (evt. 2359)</div><div><br></div><div>Så er den ged barberet, og bruger kan slet ikke indtaste et klokkeslet med et kolon.<br></div><div><br></div>]]>
   </description>
   <pubDate>Mon, 07 Jan 2019 15:06:28 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18493.html#18493</guid>
  </item> 
  <item>
   <title><![CDATA[Kode - Husk position : Hvis du ligger koden ind i &amp;#039;Worksheet_Change&amp;#039;...]]></title>
   <link>https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18492.html#18492</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=732">EXCELGAARD</a><br /><strong>Emne:</strong> 3741<br /><strong>Sendt:</strong> 07.Jan.2019 kl. 15:04<br /><br /><div>Hvis du ligger koden ind i 'Worksheet_Change' eventen, så vil objektet 'Target' altid indholde cellen, som sidst er blevet ændret...</div><div>...denne kan du så benytte.<table width="99%"><tr><td><pre class="BBcode">Target.Select</div><div>Target.Value = ""</pre></td></tr></table><br></div>]]>
   </description>
   <pubDate>Mon, 07 Jan 2019 15:04:32 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18492.html#18492</guid>
  </item> 
  <item>
   <title><![CDATA[Kode - Husk position : Hej Forum- Jeg har en kode direkte...]]></title>
   <link>https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18491.html#18491</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=1125">Ib Hansen</a><br /><strong>Emne:</strong> 3741<br /><strong>Sendt:</strong> 07.Jan.2019 kl. 12:17<br /><br />Hej Forum<div><br></div><div>- Jeg har en kode direkte i Sheets("Ark1").</div><div>- Koden aktiveres, hvis der tastes en separator i et klokkeslæt, hvilket man ikke må.</div><div>- Koden hopper Offset(-1, 0) op til cellen og sletter det indtastede, hvorefter der kommer MsgBox.</div><div>- Men det er kun hvis Enter tasten bruges, den hopper Offset op.</div><div><br></div><div><b>Det jeg søger er en kode</b>, der husker sidste position og hopper tilbage til den og sletter det indtastede.</div><div>Dette da man kan bruge pil-tasterne i stedet for Enter-tasten og hvis f.eks. Pil-højre bruges, hopper den til højre i stedet for nedad og sletter Offset cellen oven over.<br>Det dutter ette&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley7.gif" border="0" alt="Angry" title="Angry" /></div><div><br></div><div>Koden det drejer som om, er mærket med rødt.</div><div><table width="99%"><tr><td><pre class="BBcode">On Error Resume Next</div><div><b><font color="#ff0000">&nbsp;ActiveCell.Offset(-1, 0).Select: Selection = ""</font></b></div><div><b><font color="#009900">'Dialog Message</font></b></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;QuestionToMessageBox = "&nbsp; &nbsp;Ugyldig indtastning !" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; vbNewLine &amp; "&nbsp; &nbsp;Der er enten brugt separator." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;Eller det er et ugyldigt klokkeslæt." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; vbNewLine &amp; "&nbsp; &nbsp;Skriv et korrekt klokkeslæt, som et helt tal, uden separator." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 1&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;00:01" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 12&nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;00:12" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 123&nbsp; &nbsp; =&nbsp; &nbsp;01:23" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 1234&nbsp; =&nbsp; &nbsp;12:34" _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; vbNewLine &amp; "&nbsp; &nbsp;Midnat, klokken 24:00, skrives altid som 0." _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &amp; vbNewLine &amp; "&nbsp; &nbsp;-&nbsp; 0&nbsp; &nbsp; &nbsp; &nbsp; =&nbsp; &nbsp;24:00"</div><div><font color="#009900"><b>'MsgBox Title</b></font></div><div>&nbsp; &nbsp; &nbsp; &nbsp; YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbOKOnly + vbInformation, "")</div><div></pre></td></tr></table></div><div><br></div><div>På forhånd tak</div><div><br></div><div>Mvh.</div><div>Ib</div>]]>
   </description>
   <pubDate>Mon, 07 Jan 2019 12:17:59 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/kode-husk-position_topic3741_post18491.html#18491</guid>
  </item> 
 </channel>
</rss>