<?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 : Hjælp til variabler</title>
  <link>https://forum.excel-regneark.dk/</link>
  <description><![CDATA[Dette er et XML Feed af; Dansk Regneark Forum : Makro og VBA : Hjælp til variabler]]></description>
  <pubDate>Sat, 05 Dec 2026 14:19:18 +0000</pubDate>
  <lastBuildDate>Thu, 12 Apr 2018 08:27:20 +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=3436</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[Hjælp til variabler : Velbekomme ]]></title>
   <link>https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17089.html#17089</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=732">EXCELGAARD</a><br /><strong>Emne:</strong> 3436<br /><strong>Sendt:</strong> 12.Apr.2018 kl. 08:27<br /><br />Velbekomme <img src="https://forum.excel-regneark.dk/smileys/smiley1.gif" border="0" alt="Smile" title="Smile" /><br>]]>
   </description>
   <pubDate>Thu, 12 Apr 2018 08:27:20 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17089.html#17089</guid>
  </item> 
  <item>
   <title><![CDATA[Hjælp til variabler : Ok, s&#229;dan havde jeg ogs&#229; lavet...]]></title>
   <link>https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17088.html#17088</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=2155">nordicdust</a><br /><strong>Emne:</strong> 3436<br /><strong>Sendt:</strong> 12.Apr.2018 kl. 07:16<br /><br />Ok, sådan havde jeg også lavet det først, og det virkede.<div>Jeg synes bare det var lidt smartere og lidt mere ryddeligt med 'UserInterfaceOnly'</div><div>Tak for hjælpen<img src="https://forum.excel-regneark.dk/smileys/smiley1.gif" border="0" alt="Smile" title="Smile" /></div>]]>
   </description>
   <pubDate>Thu, 12 Apr 2018 07:16:38 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17088.html#17088</guid>
  </item> 
  <item>
   <title><![CDATA[Hjælp til variabler : Du kan ikke benytte &amp;#039;UserInterfaceOnly&amp;#039;,...]]></title>
   <link>https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17087.html#17087</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=732">EXCELGAARD</a><br /><strong>Emne:</strong> 3436<br /><strong>Sendt:</strong> 12.Apr.2018 kl. 07:09<br /><br />Du kan ikke benytte 'UserInterfaceOnly', når du beskytter en Workbook.<table width="99%"><tr><td><pre class="BBcode">With WB<div>&nbsp;&nbsp;&nbsp; .Protect password:=pw, UserInterFaceOnly:=True</pre></td></tr></table>skal være<table width="99%"><tr><td><pre class="BBcode">With WB<div>&nbsp;&nbsp;&nbsp; .Protect password:=pw</pre></td></tr></table><br></div></div>]]>
   </description>
   <pubDate>Thu, 12 Apr 2018 07:09:19 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17087.html#17087</guid>
  </item> 
  <item>
   <title><![CDATA[Hjælp til variabler : Som total ny i VBA har jeg kastet...]]></title>
   <link>https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17085.html#17085</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=2155">nordicdust</a><br /><strong>Emne:</strong> 3436<br /><strong>Sendt:</strong> 11.Apr.2018 kl. 18:19<br /><br />Som total ny i VBA har jeg kastet mig i noget som jeg ikke har styr på<img src="https://forum.excel-regneark.dk/smileys/smiley4.gif" border="0" alt="Big smile" title="Big smile" /><div>Heldigvis kan man læse meget på nettet og der meget undervisning på Youtube men jeg er utålmodig nu. Hvad er der galt med min kode?</div><div>Jeg har en version der virker, men den er lidt roddet skrevet og så ville jeg forsøge at gøre den mere overskuelig og nu for jeg den ikke til at virke. Jeg har kun været i gang et par måneder og derfor ser jeg ikke åbenlyse ting, men det gør I&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley9.gif" border="0" alt="Embarrassed" title="Embarrassed" /></div><div><br></div><div>Dette er det første i modulet, der er en del små macroer efter men de virker.</div><div>Håber på en venlig sjæl&nbsp;<img src="https://forum.excel-regneark.dk/smileys/smiley1.gif" border="0" alt="Smile" title="Smile" /></div><div><br></div><div><br></div><div>Option Explicit</div><div>Public Pass As String</div><div>Public CalcState As Long</div><div>Public EventState As Boolean</div><div>Public PageBreakState As Boolean</div><div>Public Worksheet As Boolean</div><div>Dim WS As Worksheet</div><div>Dim WB As Workbook</div><div>Dim password As String</div><div><br></div><div>Private Const pw As String = "test"</div><div><br></div><div>Private Sub ProtectSheet(ByVal WS As Worksheet)</div><div>&nbsp; &nbsp; With WS</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Protect password:=pw, UserInterFaceOnly:=True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .EnableOutlining = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>End With</div><div>End Sub</div><div><br></div><div>Private Sub ProtectBook(ByVal WS As Worksheet)</div><div>&nbsp; &nbsp; With WB</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Protect password:=pw, UserInterFaceOnly:=True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .EnableOutlining = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>End With</div><div>End Sub</div><div><br></div><div><br></div><div>Public Sub UnlockAndBoost(ByVal WS As Worksheet, Optional ByVal applyLock As Boolean = False)</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; If Not applyLock Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; WS.Unprotect pw</div><div>&nbsp; &nbsp; &nbsp; &nbsp; WB.Unprotect pw</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; With Application</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Calculation = xlCalculationManual</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .ScreenUpdating = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .EnableEvents = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayAlerts = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayPageBreaks = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayFormulaBar = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayStatusBar = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End With</div><div>&nbsp; &nbsp; Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; With Application</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Calculation = xlCalculationAutomatic</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .ScreenUpdating = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .EnableEvents = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayAlerts = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayPageBreaks = True</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayFormulaBar = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .DisplayStatusBar = False</div><div>&nbsp; &nbsp; &nbsp; &nbsp; End With</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ProtectSheet WS</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ProtectBook WB</div><div>&nbsp; &nbsp; End If</div><div>End Sub&nbsp;</div><div><br></div><div><div>Private Sub GOTO_DATA()</div><div>top:</div><div>Pass = InputBox("password?")</div><div>If (Pass = "Admin") Then</div><div>UnlockAndBoost WS, False</div><div>ThisWorkbook.Worksheets("DATA").Activate</div><div><br></div><div>ThisWorkbook.Worksheets("DATA").Visible = xlSheetVisible</div><div>UnlockAndBoost WS, True</div><div><br></div><div>Else</div><div>MsgBox "WRONG PASSWORD"</div><div><br></div><div>End If</div><div>End Sub</div></div>]]>
   </description>
   <pubDate>Wed, 11 Apr 2018 18:19:01 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/hjlp-til-variabler_topic3436_post17085.html#17085</guid>
  </item> 
 </channel>
</rss>