<?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 : Genkald data</title>
  <link>https://forum.excel-regneark.dk/</link>
  <description><![CDATA[Dette er et XML Feed af; Dansk Regneark Forum : Makro og VBA : Genkald data]]></description>
  <pubDate>Sat, 05 Dec 2026 14:23:51 +0000</pubDate>
  <lastBuildDate>Mon, 04 Sep 2017 17:35:50 +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=3148</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[Genkald data : Hej AlleJeg har en Userform hvor...]]></title>
   <link>https://forum.excel-regneark.dk/genkald-data_topic3148_post15356.html#15356</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://forum.excel-regneark.dk/member_profile.asp?PF=527">Matlock</a><br /><strong>Emne:</strong> 3148<br /><strong>Sendt:</strong> 04.Sep.2017 kl. 17:35<br /><br />Hej Alle<div><br><div>Jeg har en Userform hvor i jeg vil lave en aftaleseddel.</div><div><br></div><div><img src="uploads/527/aft1.PNG" height="738" width="632" border="0" /><br></div><div><br></div><div>Men kunne godt tænke mig at hvis jeg nu havde lavet en aftaleseddel, og overført værdierne til en database, at jeg kunne genkalde alle værdierne i userformen hvis jeg valgt et aftaleseddel nr. der allerede var blevet brugt igen.</div><div><br></div><div>Her er koden</div><div><br></div><div><div>Private Sub cmdAnnullere_Click()</div><div><br></div><div>&nbsp; &nbsp; Unload Me</div><div>&nbsp; &nbsp;&nbsp;</div><div>End Sub</div><div><br></div><div>Private Sub CommandButton1_Click()</div><div><br></div><div>&nbsp; &nbsp; If cboAftale.Text = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; MsgBox "Skriv venligst aftaleseddel nr."</div><div>&nbsp; &nbsp; &nbsp; &nbsp; txtaftaleseddelnr.SetFocus</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; If txtDato.Text = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; MsgBox "Skriv venligst dato"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; txtDato.SetFocus</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; If txtbesk.Text = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; MsgBox "Skriv venligst en beskrivelse af det udførte arbejde"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; txtbesk.SetFocus</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; If txtVare1.Text = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; MsgBox "Skriv venligst en vare"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; txtVare1.SetFocus</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; If txtPris1.Text = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; MsgBox "Skriv venligst en pris"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; txtPris1.SetFocus</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Exit Sub</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("K3").Select</div><div>&nbsp; &nbsp; If Range("K3").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("K3").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = cboAftale.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("C47").Select</div><div>&nbsp; &nbsp; If Range("C47").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("C47").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtDato.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B15").Select</div><div>&nbsp; &nbsp; If Range("B15").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B15").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtbesk.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B24").Select</div><div>&nbsp; &nbsp; If Range("B24").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B24").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtVare1.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("J24").Select</div><div>&nbsp; &nbsp; If Range("J24").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("J24").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtPris1.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B26").Select</div><div>&nbsp; &nbsp; If Range("B26").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B26").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtVare2.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("J26").Select</div><div>&nbsp; &nbsp; If Range("J26").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("J26").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtPris2.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B28").Select</div><div>&nbsp; &nbsp; If Range("B28").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B28").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtVare3.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("J28").Select</div><div>&nbsp; &nbsp; If Range("J28").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("J28").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtPris3.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B30").Select</div><div>&nbsp; &nbsp; If Range("B30").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B30").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtVare4.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("J30").Select</div><div>&nbsp; &nbsp; If Range("J30").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("J30").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtPris4.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B32").Select</div><div>&nbsp; &nbsp; If Range("B32").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B32").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtVare5.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("J32").Select</div><div>&nbsp; &nbsp; If Range("J32").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("J32").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtPris5.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("B34").Select</div><div>&nbsp; &nbsp; If Range("B34").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("B34").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtVare6.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; Range("J34").Select</div><div>&nbsp; &nbsp; If Range("J34").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("J34").Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtPris6.Text</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; nr = &#091;Aftaleseddel!D2&#093;</div><div>&nbsp; &nbsp; ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; "C:\Users\bbj\Desktop\Test\Aftalesedler\Aftaleseddel Nr" &amp; nr &amp; ".pdf", Quality:=xlQualityStandard, _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _</div><div>&nbsp; &nbsp; &nbsp; &nbsp; True</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Bilag B").Activate</div><div>&nbsp; &nbsp; Range("E4").Select</div><div>&nbsp; &nbsp; If Range("E4").Value = "" Then</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("E4").Activate</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; Range("E4").CurrentRegion.Select</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ActiveCell.Offset(Selection.Rows.Count, 1).Activate</div><div>&nbsp; &nbsp; End If</div><div>&nbsp; &nbsp; With ActiveCell</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Value = txtbesk.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 1).Value = Range("Aftaleseddel!Ialt")</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 5).Value = txtDato.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 6).Value = txtVare1.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 7).Value = txtPris1.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 8).Value = txtVare2.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 9).Value = txtPris2.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 10).Value = txtVare3.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 11).Value = txtPris3.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 12).Value = txtVare4.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 13).Value = txtPris4.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 14).Value = txtVare5.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 15).Value = txtPris5.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 16).Value = txtVare6.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .Offset(0, 17).Value = txtPris6.Text</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; End With</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; ActiveCell.Offset(1).EntireRow.Insert</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Worksheets("Aftaleseddel").Activate</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("K3").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("C47").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B15").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B24").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("J24").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B26").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("J26").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B28").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("J28").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B30").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("J30").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B32").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("J32").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("B34").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Range("J34").Select</div><div>&nbsp; &nbsp; Selection.ClearContents</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Unload Me</div><div>&nbsp; &nbsp;&nbsp;</div><div>End Sub</div><div>&nbsp; &nbsp;</div><div>Private Sub UserForm_Activate()</div><div><br></div><div><br></div><div>&nbsp; &nbsp; With cboAftale</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .RowSource = "Aftalenr"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; .ListIndex = 0</div><div>&nbsp; &nbsp; End With</div><div><br></div><div>txtDato.Text = Format(Now, "dd-mmm-yyyy")</div><div><br></div><div><br></div><div>End Sub</div><div><br></div></div><div><br></div><div>Håber i kan hjælpe</div><div><br></div></div>]]>
   </description>
   <pubDate>Mon, 04 Sep 2017 17:35:50 +0000</pubDate>
   <guid isPermaLink="true">https://forum.excel-regneark.dk/genkald-data_topic3148_post15356.html#15356</guid>
  </item> 
 </channel>
</rss>