<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Profi-Excel.de &#187; VBA Makros</title>
	<atom:link href="http://www.profi-excel.de/vba_makros/feed" rel="self" type="application/rss+xml" />
	<link>http://www.profi-excel.de</link>
	<description>Die Seite für den professionellen Umgang mit Excel und VBA</description>
	<lastBuildDate>Wed, 23 Mar 2011 21:01:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Kleinanzeigen Suche</title>
		<link>http://www.profi-excel.de/vba_makros/kleinanzeigen-suche.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/kleinanzeigen-suche.htm#comments</comments>
		<pubDate>Tue, 22 Mar 2011 21:55:57 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/?p=107</guid>
		<description><![CDATA[Das Beispiel zeigt, wie man mit VBA auf Webseiten - in diesem Fall auf Kleinanzeigenportale - zugreifen kann und die Inhalte der Webseite auswertet. Zunächst muss der Verweis (im VBE unter Extras - Verweise auf die Microsoft HTML Object Library gesetzt werden. Dann ist es möglich ein neues Objekt vom Typ MSHTML.HTMLDocument anzulegen. Dieses Objekt [...]]]></description>
			<content:encoded><![CDATA[<p>Das Beispiel zeigt, wie man mit VBA auf Webseiten - in diesem Fall auf Kleinanzeigenportale - zugreifen kann und die Inhalte der Webseite auswertet.<br />
Zunächst muss der Verweis (im VBE unter Extras - Verweise auf die Microsoft HTML Object Library gesetzt werden. Dann ist es möglich ein neues Objekt vom Typ MSHTML.HTMLDocument anzulegen. Dieses Objekt kennt die Methode "createDocumentFromUrl", der man im Wesentlichen die URL der Webseite übergibt.</p>
<p>Bei den meisten Portalen ist es möglich, die Suche nach <a title="Kleinanzeigen" href="http://www.findix.com/" target="_blank">Kleinanzeigen</a> über eine URL und der Angabe des Suchbegriffs zu starten. Findix.com hat das sehr einfach gelöst und bietet die URL http://www.findix.com/suche/ an, die direkt mit dem Suchbegriff verknüpft werden kann d.h. z.B. http://www.findix.com/suche/fahrrad. Bei Quoka ist die Syntax etwas komplizierter (Übergabe des Arguments "Search1" an die cfm Funktion), aber der Suchbegriff kann auch hier einfach hinten an die URL angehängt werden.</p>
<p>Der Aufruf von "createDocumentFromUrl" liefert ein Objekt zurück, dass wesentliche Informationen zur Webseite enthält. Am Einfachsten kann man sich die Struktur und die Details des Objekts im Lokalfenster im Debug-Mode ansehen. In diesem Codebeispiel wird im Element "Body" die innerText-Eigenschaft ausgelesen, die den Webseiten Inhalt enthält.</p>
<p>Anschließend kann beispielhaft in den Ergebnissen in myResults(k).BodyResult mit einer Schleife nach<br />
weiteren Details gesucht werden.</p>
<div class="igBar"><span id="lvba-2"><a href="#" onclick="javascript:showPlainTxt('vba-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-2">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Type</span> SearchWebType</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  Website <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  HTMLSearchQuery <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  BodyResult <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Type</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> Kleinanzeigen_Suche<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'Verweis notwendig: Microsoft HTML Object Library</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'HTML Seiten abrufen und Seiteninhalt durchsuchen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'03-2011</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'E.Bimczok http://profi-excel.de</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'Liest beispielhaft die Webseiten der Kleinanzeigenportale</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'Findix.com und Quoka.de ein</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> objMSHTML <span style="color: #00007F;">As</span> <span style="color: #00007F;">New</span> MSHTML.<span style="color: #000000;">HTMLDocument</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myHTMLDoc <span style="color: #00007F;">As</span> <span style="color: #00007F;">New</span> MSHTML.<span style="color: #000000;">HTMLDocument</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myResults<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">As</span> SearchWebType</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myWebsiteSearch <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> subSearchString <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> k <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> foundPos <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">ReDim</span> myResults<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span> <span style="color: #00007F;">To</span> <span style="color: #000000;color:#000000;">2</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myWebsiteSearch = <span style="color: #000000;">"Fahrrad"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">subSearchString = <span style="color: #000000;">"BMX"</span> <span style="color: #007F00;">'nach Begriff in den Ergebnissen suchen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myResults<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span><span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">Website</span> = <span style="color: #000000;">"http://www.findix.com"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myResults<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span><span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">HTMLSearchQuery</span> = <span style="color: #000000;">"http://www.findix.com/suche/"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myResults<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">2</span><span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">Website</span> = <span style="color: #000000;">"http://www.quoka.de"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myResults<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">2</span><span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">HTMLSearchQuery</span> = <span style="color: #000000;">"http://www.quoka.de/searchresult.cfm?SEARCH1="</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'alle definierten Webseiten abrufen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>myResults<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>myResults<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #007F00;">'z.B. http://www.findix.com/suche/fahrrad</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">Set</span> myHTMLDoc = objMSHTML.<span style="color: #000000;">createDocumentFromUrl</span><span style="color:#000000; font-weight:bold;">&#40;</span> _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">     myResults<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">HTMLSearchQuery</span> &amp; myWebsiteSearch, _</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">     <span style="color: #00007F;">vbNullString</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #007F00;">'Abwarten, bis die Seite geladen ist</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">While</span> myHTMLDoc.<span style="color: #000000;">readyState</span> &lt;&gt; <span style="color: #000000;">"complete"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">DoEvents</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">Wend</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  myResults<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">BodyResult</span> = myHTMLDoc.<span style="color: #000000;">body</span>.<span style="color: #000000;">innerText</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'detaillierte Suche</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>myResults<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>myResults<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  foundPos = <span style="color: #00007F;">InStr</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span>, myResults<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">BodyResult</span>, subSearchString, <span style="color: #00007F;">vbTextCompare</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">If</span> foundPos&gt; <span style="color: #000000;color:#000000;">0</span> <span style="color: #00007F;">Then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #007F00;">'wenn Begriff gefunden wurde, 20 Zeichen davor</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #007F00;">'und 200 Zeichen danach anzeigen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">MsgBox</span> <span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"Webseite: "</span> &amp; myResults<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">Website</span> &amp; <span style="color: #00007F;">vbCr</span> &amp; _</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">Mid</span><span style="color:#000000; font-weight:bold;">&#40;</span>myResults<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">BodyResult</span>, foundPos - <span style="color: #000000;color:#000000;">20</span>, <span style="color: #000000;color:#000000;">200</span><span style="color:#000000; font-weight:bold;">&#41;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">End</span> <span style="color: #00007F;">If</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/kleinanzeigen-suche.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suche mit Regular Expressions in VBA</title>
		<link>http://www.profi-excel.de/vba_makros/suche-mit-regular-expressions-in-vba.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/suche-mit-regular-expressions-in-vba.htm#comments</comments>
		<pubDate>Fri, 18 Mar 2011 19:28:23 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/?p=99</guid>
		<description><![CDATA[VBA kennt von sich aus keine Regulären Ausdrücke. Um einen ersten Einstieg in den Umgang mit Regulären Ausdrücken zu bekommen, gibt es unten ein Beispiel, wie man die Bibliothek verfügbar macht. Über CreateObject erzeugt man das Objekt. Die Pattern Eigenschaft legt das Pattern für die Suche fest, hierbei werden üblicherweise Zeichenklassen verwendet, wie z.B. \w [...]]]></description>
			<content:encoded><![CDATA[<p>VBA kennt von sich aus keine Regulären Ausdrücke. Um einen ersten Einstieg in den Umgang mit Regulären Ausdrücken zu bekommen, gibt es unten ein Beispiel, wie man die Bibliothek verfügbar macht.<br />
Über CreateObject erzeugt man das Objekt. Die Pattern Eigenschaft legt das Pattern für die Suche fest, hierbei werden üblicherweise Zeichenklassen verwendet, wie z.B. \w (siehe unten) oder \d für alle Zahlen, d.h. 0-9.<br />
Der Vorteil von Regulären Ausdrücken liegt in den sehr umfassenden Möglichkeiten auch komplexe Suchen bzw. Prüfungen vorzunehmen. Ein übliches Beispiel ist die Prüfung der Gültigkeit von Emailadressen.</p>
<div class="igBar"><span id="lvba-4"><a href="#" onclick="javascript:showPlainTxt('vba-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-4">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> VBA_Suche_Mit_RegularExpression<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'sucht mit der Hilfe von Regulären Ausdrücken</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'03-2011</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'E.Bimczok http://profi-excel.de</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Const</span> myText <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span> = <span style="color: #000000;">"Dieser Satz kein Verb"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myRegEx <span style="color: #00007F;">As</span> Object</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Set</span> myRegEx = <span style="color: #00007F;">CreateObject</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"VBScript.RegExp"</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'\w alle Zahlen (0-9), Buchstaben (A-z) oder &quot;_&quot;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'+ mindestens einmal aber beliebig oft</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myRegEx.<span style="color: #000000;">Pattern</span> = <span style="color: #000000;">"\w+"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Set</span> result = myRegEx.<span style="color: #000000;">Execute</span><span style="color:#000000; font-weight:bold;">&#40;</span>myText<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">MsgBox</span> result<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">0</span><span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">Value</span> <span style="color: #007F00;">'Dieser</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'Buchstabe &quot;S&quot;, danach die oben beschriebene Klasse \w</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myRegEx.<span style="color: #000000;">Pattern</span> = <span style="color: #000000;">"S\w+"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Set</span> result = myRegEx.<span style="color: #000000;">Execute</span><span style="color:#000000; font-weight:bold;">&#40;</span>myText<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">MsgBox</span> result<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">0</span><span style="color:#000000; font-weight:bold;">&#41;</span>.<span style="color: #000000;">Value</span> <span style="color: #007F00;">'Satz</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/suche-mit-regular-expressions-in-vba.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mehrfach Suchen und Ersetzen mit Statistik</title>
		<link>http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen-mit-statistik.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen-mit-statistik.htm#comments</comments>
		<pubDate>Mon, 07 Mar 2011 19:57:37 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/?p=79</guid>
		<description><![CDATA[Mehrfaches "Suchen und Ersetzen" hat bereits in diesem Artikel viel Interesse erzeugt. Die Frage nach statistischen Informationen ließ sich aber nicht so einfach beantworten. Dazu sind einige Anpassungen am Code notwendig. Excel bietet über den Aufruf im Menü "Suchen und Ersetzen" von sich aus bereits die Informationen, wie viele Inhalte ersetzt wurden. Leider ist es [...]]]></description>
			<content:encoded><![CDATA[<p>Mehrfaches "Suchen und Ersetzen" hat bereits in diesem <a title="Artikel" href="http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen.htm" target="_blank">Artikel </a>viel Interesse erzeugt. Die Frage nach statistischen Informationen ließ sich aber nicht so einfach beantworten. Dazu sind einige Anpassungen am Code notwendig.<br />
Excel bietet über den Aufruf im Menü "Suchen und Ersetzen" von sich aus bereits die Informationen, wie viele Inhalte ersetzt wurden. Leider ist es nach meiner Kenntnis nicht möglich, diese Informationen über VBA direkt <span id="more-79"></span> zu erreichen. Die Lösung liegt in der Programmierung von zwei verschachtelten Schleifen. Die äußere Schleife durchläuft die Suchbegriffe, die innere Schleife alle Einträge des Tabellenblattes. Der Aufruf der instr-Funktion dient nur dem Erhalt der Information, ob der Suchbegriff in der Zelle vorhanden ist. In diesem Fall wird der Zähler für den jeweiligen Begriff inkrementiert.</p>
<p>Möchte man nicht den "Value" der Zelle ersetzen, kann alternativ auch mittels myCell.FormulaLocal beispielsweise eine Formel ersetzt werden.</p>
<div class="igBar"><span id="lvba-6"><a href="#" onclick="javascript:showPlainTxt('vba-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-6">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> mehrfachSuchenUndErsetzenMitStatistik<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'sucht im aktiven Tabellenblatt jeweils die Eintraege aus</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'suchArray und ersetzt mit ersetzArray</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'03-2011</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'E.Bimczok http://profi-excel.de</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> suchArray<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> ersetzArray<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> StatistikArray<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> k <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myCell <span style="color: #00007F;">As</span> Range</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> Zellinhalt <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> Ausgabe <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">suchArray = <span style="color: #00007F;">Array</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"a"</span>, <span style="color: #000000;">"b"</span>, <span style="color: #000000;">"c"</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ersetzArray = <span style="color: #00007F;">Array</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"1"</span>, <span style="color: #000000;">"2"</span>, <span style="color: #000000;">"3"</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">ReDim</span> StatistikArray<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'alle Suchbegriffe durchlaufen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #007F00;">'alle Zellen im verwendeten Bereich durchlaufen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myCell <span style="color: #00007F;">In</span> ActiveSheet.<span style="color: #000000;">UsedRange</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #007F00;">'Ersetzung durchfuehren</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    Zellinhalt = myCell.<span style="color: #000000;">Value</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">If</span> <span style="color: #00007F;">InStr</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span>, Zellinhalt, suchArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, <span style="color: #00007F;">vbTextCompare</span><span style="color:#000000; font-weight:bold;">&#41;</span>&gt; <span style="color: #000000;color:#000000;">0</span> <span style="color: #00007F;">Then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">      myCell.<span style="color: #000000;">Value</span> = Replace<span style="color:#000000; font-weight:bold;">&#40;</span>Zellinhalt, suchArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, ersetzArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, , , <span style="color: #00007F;">vbTextCompare</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">      StatistikArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> = StatistikArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> + <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">End</span> <span style="color: #00007F;">If</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">Next</span> myCell</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Ausgabe = <span style="color: #000000;">"Folgende Ersetzungen wurden durchgeführt:"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  Ausgabe = Ausgabe &amp; <span style="color: #00007F;">vbCr</span> &amp; suchArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> &amp; <span style="color: #000000;">" --&gt; "</span> &amp; ersetzArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> &amp; <span style="color: #000000;">": "</span> &amp; StatistikArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> &amp; <span style="color: #000000;">" Ersetzungen"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">MsgBox</span> Ausgabe</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen-mit-statistik.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel Diagramm Linien auf schwarz-weiss stellen</title>
		<link>http://www.profi-excel.de/vba_makros/excel-diagramm-linien-auf-schwarz-weiss-stellen.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/excel-diagramm-linien-auf-schwarz-weiss-stellen.htm#comments</comments>
		<pubDate>Wed, 13 May 2009 20:07:13 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/?p=41</guid>
		<description><![CDATA[Falls man in Diagrammen die Linienfarben auf schwarz stellen möchte, lässt sich das einfach mit diesem Makro unterstützen. So lassen sich auf Knopfdruck alle Diagramme innerhalb einer Excel-Datei umstellen. Zur Funktion des Makros: Die erste For-Each-Schleife durchläuft alle Blätter der Datei, die zweite Schleife alle Diagramme und die dritte Schleife alle Linien des Diagramms.  Der [...]]]></description>
			<content:encoded><![CDATA[<p>Falls man in Diagrammen die Linienfarben auf schwarz stellen möchte, lässt sich das einfach mit diesem Makro unterstützen. So lassen sich auf Knopfdruck alle Diagramme innerhalb einer Excel-Datei umstellen.</p>
<p>Zur Funktion des Makros:<span id="more-41"></span></p>
<p>Die erste For-Each-Schleife durchläuft alle Blätter der Datei, die zweite Schleife alle Diagramme und die dritte Schleife alle Linien des Diagramms. </p>
<p>Der ColorIndex wird auf 1 gesetzt (schwarz) und der Linienfarbe, dem Marker und der Markerfüllung zugewiesen.</p>
<p> </p>
<p>Siehe auch <a href="http://www.profi-excel.de/vba_makros/diagramm-linien-einfarben.htm">http://www.profi-excel.de/vba_makros/diagramm-linien-einfarben.htm</a></p>
<div class="igBar"><span id="lvba-8"><a href="#" onclick="javascript:showPlainTxt('vba-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-8">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> DiagrammeSW<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> mySht <span style="color: #00007F;">As</span> Worksheet</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myDia <span style="color: #00007F;">As</span> Object</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myLine <span style="color: #00007F;">As</span> Object</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> lineColorIndex <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> mySht <span style="color: #00007F;">In</span> ActiveWorkbook.<span style="color: #000000;">Sheets</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   </div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myDia <span style="color: #00007F;">In</span> mySht.<span style="color: #000000;">ChartObjects</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">     </div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">      <span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myLine <span style="color: #00007F;">In</span> myDia.<span style="color: #000000;">Chart</span>.<span style="color: #000000;">SeriesCollection</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        lineColorIndex = <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">       </div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        myLine.<span style="color: #000000;">MarkerBackgroundColorIndex</span> = lineColorIndex</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        myLine.<span style="color: #000000;">MarkerForegroundColorIndex</span> = lineColorIndex</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        myLine.<span style="color: #000000;">Border</span>.<span style="color: #000000;">ColorIndex</span> = lineColorIndex</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">      <span style="color: #00007F;">Next</span> myLine</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">     </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">Next</span> myDia</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> mySht</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">MsgBox</span> <span style="color: #000000;">"Linien auf schwarz umgestellt"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/excel-diagramm-linien-auf-schwarz-weiss-stellen.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diagramm Linien einfärben</title>
		<link>http://www.profi-excel.de/vba_makros/diagramm-linien-einfarben.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/diagramm-linien-einfarben.htm#comments</comments>
		<pubDate>Wed, 13 May 2009 19:54:23 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/?p=31</guid>
		<description><![CDATA[Falls man in Diagrammen die Linienfarben ändern möchte, lässt sich das einfach mit diesem Makro unterstützen. So lassen sich auf Knopfdruck alle Diagramme innerhalb einer Excel-Datei abhängig von der Linienart (Markierung) einfärben. Zur Funktion des Makros: Die erste For-Each-Schleife durchläuft alle Blätter der Datei, die zweite Schleife alle Diagramme und die dritte Schleife alle Linien [...]]]></description>
			<content:encoded><![CDATA[<p>Falls man in Diagrammen die Linienfarben ändern möchte, lässt sich das einfach mit diesem Makro unterstützen. So lassen sich auf Knopfdruck alle Diagramme innerhalb einer Excel-Datei abhängig von der Linienart (Markierung) einfärben.</p>
<p>Zur Funktion des Makros:<span id="more-31"></span></p>
<p>Die erste For-Each-Schleife durchläuft alle Blätter der Datei, die zweite Schleife alle Diagramme und die dritte Schleife alle Linien des Diagramms.  Abhängig vom MarkerStyle wird in der Select Case Anweisung der ColorIndex definiert.</p>
<p>Der ColorIndex wird dann der Linienfarbe, dem Marker und der Markerfüllung zugewiesen.</p>
<div class="igBar"><span id="lvba-10"><a href="#" onclick="javascript:showPlainTxt('vba-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-10">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> DiagrammeFaerben<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> mySht <span style="color: #00007F;">As</span> Worksheet</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myDia <span style="color: #00007F;">As</span> Object</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myLine <span style="color: #00007F;">As</span> Object</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> lineColorIndex <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> mySht <span style="color: #00007F;">In</span> ActiveWorkbook.<span style="color: #000000;">Sheets</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myDia <span style="color: #00007F;">In</span> mySht.<span style="color: #000000;">ChartObjects</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">     </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">      <span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myLine <span style="color: #00007F;">In</span> myDia.<span style="color: #000000;">Chart</span>.<span style="color: #000000;">SeriesCollection</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        XlMarkerStyle kann eine der folgenden</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        XlMarkerStyle-Konstanten sein.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleAutomatic. Automatische Markierungen.</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleCircle. Runde Markierungen.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleDash. Lange Balken als Markierungen.</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleDiamond. Rautenförmige Markierungen.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleDot. Kurze Balken als Markierungen.</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleNone. Keine Markierung.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStylePicture. Bildmarkierungen.</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStylePlus. Quadratische Markierungen mit Pluszeichen.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleSquare. Quadratische Markierungen.</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleStar Quadratische Markierungen mit Sternchen.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleTriangle. Dreieckige Markierungen.</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'        xlMarkerStyleX. Quadratische Markierungen mit einem X.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        Select <span style="color: #00007F;">Case</span> myLine.<span style="color: #000000;">MarkerStyle</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleCircle</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleDash</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlDiamond</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">3</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleDot</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">4</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleNone</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">5</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStylePicture</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">6</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStylePlus</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">7</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleSquare</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">8</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleStar</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">9</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleTriangle</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">10</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> xlMarkerStyleX</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">11</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">          <span style="color: #00007F;">Case</span> <span style="color: #00007F;">Else</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">            lineColorIndex = <span style="color: #000000;color:#000000;">12</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        <span style="color: #00007F;">End</span> Select</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">       </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        myLine.<span style="color: #000000;">MarkerBackgroundColorIndex</span> = lineColorIndex</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        myLine.<span style="color: #000000;">MarkerForegroundColorIndex</span> = lineColorIndex</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">        myLine.<span style="color: #000000;">Border</span>.<span style="color: #000000;">ColorIndex</span> = lineColorIndex</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">      <span style="color: #00007F;">Next</span> myLine</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">     </div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #00007F;">Next</span> myDia</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">   </div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> mySht</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">MsgBox</span> <span style="color: #000000;">"eingefärbt"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/diagramm-linien-einfarben.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doppelte Einträge entfernen und Übereinstimmungen suchen</title>
		<link>http://www.profi-excel.de/vba_makros/doppelte-eintraege-entfernen-und-uebereinstimmungen-suchen.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/doppelte-eintraege-entfernen-und-uebereinstimmungen-suchen.htm#comments</comments>
		<pubDate>Sun, 15 Jun 2008 08:18:39 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/?p=27</guid>
		<description><![CDATA[Mit einer Collection ist in VBA einiges möglich. Doppelte Einträge lassen sich eliminieren, indem beim Hinzufügen des Elements zur Collection ein eindeutiger "Key" zugewiesen wird. Jeder Key darf nur einmal in der Collection vorhanden sein. Beim zweiten Versuch, ein identisches Element mit dem identischen Key hinzuzufügen, wird der Vorgang mit einer Fehlermeldung abgebrochen. On Error [...]]]></description>
			<content:encoded><![CDATA[<p>Mit einer Collection ist in VBA einiges möglich. Doppelte Einträge lassen sich eliminieren, indem beim Hinzufügen des Elements zur Collection ein eindeutiger "Key" zugewiesen wird. Jeder Key darf nur einmal in <span id="more-27"></span>der Collection vorhanden sein. Beim zweiten Versuch, ein identisches Element mit dem identischen Key hinzuzufügen, wird der Vorgang mit einer Fehlermeldung abgebrochen. On Error Resume Next verhindert die Fehlermeldung.<br />
Weiterhin lassen sich zwei Collections miteinander vergleichen, indem man versucht, das Element direkt über den Key anzusprechen. Übereinstimmenden Einträge können so einfach aufgefunden werden.</p>
<div class="igBar"><span id="lvba-12"><a href="#" onclick="javascript:showPlainTxt('vba-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-12">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> collectionDemo<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'Doppelte Eintraege entfernen und Uebereinstimmungen suchen</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'06-2008 By E.Bimczok</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> BasisArrayA</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> BasisArrayB</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">BasisArrayA = <span style="color: #00007F;">Array</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span>, <span style="color: #000000;color:#000000;">3</span>, <span style="color: #000000;color:#000000;">5</span>, <span style="color: #000000;color:#000000;">7</span>, <span style="color: #000000;color:#000000;">8</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">BasisArrayB = <span style="color: #00007F;">Array</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span>, <span style="color: #000000;color:#000000;">1</span>, <span style="color: #000000;color:#000000;">1</span>, <span style="color: #000000;color:#000000;">1</span>, <span style="color: #000000;color:#000000;">2</span>, <span style="color: #000000;color:#000000;">3</span>, <span style="color: #000000;color:#000000;">2</span>, <span style="color: #000000;color:#000000;">3</span>, <span style="color: #000000;color:#000000;">4</span>, <span style="color: #000000;color:#000000;">3</span>, <span style="color: #000000;color:#000000;">2</span>, <span style="color: #000000;color:#000000;">5</span>, <span style="color: #000000;color:#000000;">4</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> CollA <span style="color: #00007F;">As</span> <span style="color: #00007F;">New</span> Collection</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> CollB <span style="color: #00007F;">As</span> <span style="color: #00007F;">New</span> Collection</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">On</span> <span style="color: #00007F;">Error</span> <span style="color: #00007F;">Resume</span> <span style="color: #00007F;">Next</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>BasisArrayA<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>BasisArrayA<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  CollA.<span style="color: #000000;">Add</span> BasisArrayA<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, <span style="color: #000000;">"x"</span> &amp; BasisArrayA<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>BasisArrayB<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>BasisArrayB<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  CollB.<span style="color: #000000;">Add</span> BasisArrayB<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, <span style="color: #000000;">"x"</span> &amp; BasisArrayB<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'übereinstimmungen suchen</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> c <span style="color: #00007F;">In</span> CollA</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  temp = CollB<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"x"</span> &amp; c<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">If</span> temp = c <span style="color: #00007F;">Then</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    Stop</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #007F00;">'match</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">Else</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    Stop</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #007F00;">'mismatch</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">End</span> <span style="color: #00007F;">If</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> c</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/doppelte-eintraege-entfernen-und-uebereinstimmungen-suchen.htm/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Excel Tabelle in Textform konvertieren</title>
		<link>http://www.profi-excel.de/vba_makros/excel-tabelle-in-textform-konvertieren.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/excel-tabelle-in-textform-konvertieren.htm#comments</comments>
		<pubDate>Fri, 27 Oct 2006 19:41:45 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/vba_makros/excel-tabelle-in-textform-konvertieren.htm</guid>
		<description><![CDATA[Der markierte Bereich wird spaltenweise auf die Textlänge untersucht und damit die Breite der Spalten (Anzahl der Buchstaben) festgelegt. Dabei wird die Text-Eigenschaft des Range-Objektes verwendet, so dass der angezeigte Text erscheint. Das Makro ist besonders geeignet, um Tabellenausschnitte in der Microsoft Excel Newsgroup einzufügen. Das Ergebnis sieht dann so aus: PLAIN TEXT VBA: +--------+-----------+----------+ [...]]]></description>
			<content:encoded><![CDATA[<p>Der markierte Bereich wird spaltenweise auf die Textlänge untersucht und damit die Breite der Spalten (Anzahl der Buchstaben) festgelegt. Dabei wird die Text-Eigenschaft des Range-Objektes verwendet, so dass der angezeigte Text erscheint.<span id="more-22"></span></p>
<p>Das Makro ist besonders geeignet, um Tabellenausschnitte in der Microsoft Excel Newsgroup einzufügen.</p>
<p>Das Ergebnis sieht dann so aus:</p>
<div class="igBar"><span id="lvba-15"><a href="#" onclick="javascript:showPlainTxt('vba-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-15">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+--------+-----------+----------+</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|Dieses&nbsp; |Makro&nbsp; &nbsp; &nbsp; |erstellt&nbsp; |</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+--------+-----------+----------+</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|perfekt |formatierte|ASCII&nbsp; &nbsp; &nbsp;|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+--------+-----------+----------+</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">|Tabellen|per&nbsp; &nbsp; &nbsp; &nbsp; |Knopfdruck|</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">+--------+-----------+----------+ </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Makro als Add-In kostenlos herunterladen (inkl. Menüleiste): <a id="p23" href="http://www.profi-excel.de/wp-content/uploads/2006/10/profiexcel.xla">Profi-ExcelAdd-In</a></p>
<div class="igBar"><span id="lvba-16"><a href="#" onclick="javascript:showPlainTxt('vba-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-16">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> exportAscii<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'konvertiert den markierten Tabellenbereich in</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'eine Tabelle im Textformat</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'10-2006</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'©E.Bimczok</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'http://www.profi-excel.de/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Const</span> mypath <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span> = <span style="color: #000000;">"c:\tempAsciiTable.txt"</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myRng <span style="color: #00007F;">As</span> Range</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myCol <span style="color: #00007F;">As</span> Range</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myCell <span style="color: #00007F;">As</span> Range</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myLen&nbsp; <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> maxLen <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> numRows <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> numCols <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> AsciiCount <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> fF <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> noOfSpaces <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> spaceStr <span style="color: #00007F;">As</span> <span style="color: #00007F;">String</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Set</span> myRng = Selection</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">numRows = myRng.<span style="color: #000000;">Rows</span>.<span style="color: #00007F;">Count</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">numCols = myRng.<span style="color: #000000;">Columns</span>.<span style="color: #00007F;">Count</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">ReDim</span> AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span> <span style="color: #00007F;">To</span> numRows * <span style="color: #000000;color:#000000;">2</span> + <span style="color: #000000;color:#000000;">1</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myCol <span style="color: #00007F;">In</span> myRng.<span style="color: #000000;">Columns</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">maxLen = <span style="color: #000000;color:#000000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myCell <span style="color: #00007F;">In</span> myCol.<span style="color: #000000;">Rows</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">myLen = <span style="color: #00007F;">Len</span><span style="color:#000000; font-weight:bold;">&#40;</span>myCell.<span style="color: #000000;">Text</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">maxLen = maxAB<span style="color:#000000; font-weight:bold;">&#40;</span>maxLen, myLen<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> myCell</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiCount = <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myCell <span style="color: #00007F;">In</span> myCol.<span style="color: #000000;">Rows</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>AsciiCount<span style="color:#000000; font-weight:bold;">&#41;</span> = AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>AsciiCount<span style="color:#000000; font-weight:bold;">&#41;</span> &amp;amp; _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">"+"</span> &amp;amp; <span style="color: #00007F;">String</span><span style="color:#000000; font-weight:bold;">&#40;</span>maxLen, <span style="color: #000000;">"-"</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiCount = AsciiCount + <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>AsciiCount<span style="color:#000000; font-weight:bold;">&#41;</span> = AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>AsciiCount<span style="color:#000000; font-weight:bold;">&#41;</span> &amp;amp; _</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000;">"|"</span> &amp;amp; myCell.<span style="color: #000000;">Text</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">noOfSpaces = maxLen - <span style="color: #00007F;">Len</span><span style="color:#000000; font-weight:bold;">&#40;</span>myCell.<span style="color: #000000;">Text</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">spaceStr = <span style="color: #000000;">""</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">If</span> noOfSpaces&amp;gt; <span style="color: #000000;color:#000000;">0</span> <span style="color: #00007F;">Then</span> spaceStr = <span style="color: #00007F;">String</span><span style="color:#000000; font-weight:bold;">&#40;</span>noOfSpaces, <span style="color: #000000;">" "</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>AsciiCount<span style="color:#000000; font-weight:bold;">&#41;</span> = AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>AsciiCount<span style="color:#000000; font-weight:bold;">&#41;</span> &amp;amp; spaceStr</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiCount = AsciiCount + <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> myCell</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>numRows * <span style="color: #000000;color:#000000;">2</span> + <span style="color: #000000;color:#000000;">1</span><span style="color:#000000; font-weight:bold;">&#41;</span> = AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;color:#000000;">1</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> myCol</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #000000;color:#000000;">1</span> <span style="color: #00007F;">To</span> numRows * <span style="color: #000000;color:#000000;">2</span> + <span style="color: #000000;color:#000000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> = AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span> &amp;amp; <span style="color: #00007F;">Left</span><span style="color:#000000; font-weight:bold;">&#40;</span>AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, <span style="color: #000000;color:#000000;">1</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">fF = <span style="color: #00007F;">FreeFile</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Open</span> mypath <span style="color: #00007F;">For</span> Output <span style="color: #00007F;">As</span> #fF</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #000000;color:#000000;">1</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>AsciiOut<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Print</span> #fF, AsciiOut<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Close</span> #fF</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Shell</span> <span style="color: #000000;">"notepad.exe "</span> &amp;amp; mypath, vbNormalFocus</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Function</span> maxAB<span style="color:#000000; font-weight:bold;">&#40;</span>A <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span>, B <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span><span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">If</span> A&amp;gt;= B <span style="color: #00007F;">Then</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">maxAB = A</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Else</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">maxAB = B</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">If</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Function</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/excel-tabelle-in-textform-konvertieren.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zeilennummer von Objekten bestimmen</title>
		<link>http://www.profi-excel.de/vba_makros/zeilennummer-von-objekten-bestimmen.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/zeilennummer-von-objekten-bestimmen.htm#comments</comments>
		<pubDate>Sat, 21 Oct 2006 09:30:09 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://www.profi-excel.de/vba_makros/zeilennummer-von-objekten-bestimmen.htm</guid>
		<description><![CDATA[Über die for each -Schleife wird auf alle Objekte vom Typ "shape" im aktiven Arbeitsblatt zugegriffen. Das Shape-Objekt hat die Eigenschaft TopLeftCell, die ein Rangeobjekt zurück gibt. Über die row-Eigenschaft lässt sich dann die Zeilennummer des Objektes zurückgeben. PLAIN TEXT VBA: Sub getRowOfShapes&#40;&#41; 'shows the row number of the shapes '10-2006 E.Bimczok 'www.profi-excel.de &#160; Dim myShape As Object [...]]]></description>
			<content:encoded><![CDATA[<p>Über die for each -Schleife wird auf alle Objekte vom Typ "shape" im aktiven Arbeitsblatt zugegriffen. Das Shape-Objekt hat die Eigenschaft TopLeftCell, die ein Rangeobjekt zurück gibt. Über die row-Eigenschaft lässt sich dann die<span id="more-21"></span> Zeilennummer des Objektes zurückgeben.</p>
<div class="igBar"><span id="lvba-18"><a href="#" onclick="javascript:showPlainTxt('vba-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-18">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> getRowOfShapes<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'shows the row number of the shapes</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'10-2006 E.Bimczok</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'www.profi-excel.de</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> myShape <span style="color: #00007F;">As</span> Object</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> zeile <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> <span style="color: #00007F;">Each</span> myShape <span style="color: #00007F;">In</span> ActiveSheet.<span style="color: #000000;">Shapes</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  zeile = myShape.<span style="color: #000000;">TopLeftCell</span>.<span style="color: #000000;">Row</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #007F00;">'shapeAdr = myShape.TopLeftCell.Address(0, 0)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #007F00;">'shapeName = myShape.Name</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  Stop</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> myShape</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/zeilennummer-von-objekten-bestimmen.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Makros einbinden</title>
		<link>http://www.profi-excel.de/vba_makros/makros-einbinden.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/makros-einbinden.htm#comments</comments>
		<pubDate>Sat, 23 Sep 2006 09:59:10 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://profi-excel.de/vba_makros/makros-einbinden.htm</guid>
		<description><![CDATA[ Grundsätzlich gibt es drei Möglichkeiten, Makros in Excel einzubinden Makros in einer Arbeitsmappe speichern: Das Makro ist nur für diese Datei verfügbar. Makros in der Makroarbeitsmappe "Personal.xls" speichern: Das Makro ist nur für diesen Computer, aber für alle Dateien verfügbar. Makros als Add-In speichern: Das Makro ist nur für diesen Computer, aber für alle Dateien [...]]]></description>
			<content:encoded><![CDATA[<p> Grundsätzlich gibt es drei Möglichkeiten, Makros in Excel einzubinden</p>
<ol type="A">
<li>Makros in einer <strong>Arbeitsmappe</strong> speichern: Das Makro ist nur für diese Datei verfügbar.</li>
<li>Makros in der <strong>Makroarbeitsmappe "Personal.xls"</strong> speichern: Das Makro ist nur für diesen Computer, aber für alle Dateien verfügbar.</li>
<li>Makros als <strong>Add-In</strong> speichern: Das Makro ist nur für diesen Computer, aber für alle Dateien verfügbar. Das Add-In lässt sich - wie eine Datei - einfach weitergeben</li>
</ol>
<p>A.) Wenn Sie ein Makro <em>nur in einer bestimmten Datei</em> verwenden wollen, können Sie das Makro in dieser Datei <span id="more-20"></span>abspeichern. Das hat den Vorteil, dass Sie die Datei einfach an andere weitergeben können und die Funktionalität des Makros weiterhin vorhanden ist. Das Makro funktioniert allerdings nur, wenn die Datei, in der das Makro gespeichert wurde, auch geöffnet ist. Wollen Sie das Makro also in verschiedenen Dateien anwenden, so sollten Sie B.) oder C.) verwenden, oder in Einzelfällen auch das Makro jeweils in die betroffenen Dateien kopieren. Das hat allerdings den Nachteil, dass Sie Änderungen am Makro-Code (und die gibt es erfahrungsgemäß fast immer) in allen Dateien nachziehen müssen.<br />
Zum <strong>Einbinden des Makros-Codes in der Datei</strong> gehen Sie wie folgt vor:</p>
<ol>
<li>Öffnen Sie den Makro-Editor (VBE - Visual Basic Editor) mit der Tastenkombination <strong>Alt+F11</strong> oder gehen Sie über den Menüpunkt Extras - Makro - Visual Basic Editor</li>
<li>Sie sehen überlicherweise links oben die VBA-Projektübersicht (siehe <em>Bild 1</em>), in der alle offenen Arbeitsmappen sowie alle geladenen Add-Ins angezeigt werden.<br />
Markieren Sie ein beliebiges Objekt, beispielsweise eine Tabelle in der Arbeitsmappe, in der Sie das Makro einfügen möchten. Hier im Beispiel von <em>Bild 1</em> ist das Mappe1, Tabelle1. Anschließend müssen Sie über den Menüpunkt <strong>Einfügen - Modul</strong> ein neues Modul hinzufügen. Das Ergebnis sollte ähnlich dem in <em>Bild 2</em> sein.</li>
<li>Sie sollten nun das Eingabefenster für den Makro-Code entsprechend <em>Bild 3</em> sehen. Hier können Sie eigenen Code programmieren oder Makros per Copy-and-paste einfügen.</li>
<li>Wenn Sie die Datei abspeichern, wird der eingegebene Makrocode automatisch mit der Datei gespeichert, genau wie Daten in den Tabellenblättern.</li>
</ol>
<p> Bild 1</p>
<p><img id="image16" title="VBA Makros in Excel einbinden - Projekt Explorer" alt="VBA Makros in Excel einbinden 1" src="http://profi-excel.de/wp-content/uploads/2006/09/makroeinbinden1.jpg" /></p>
<p> Bild 2</p>
<p><img id="image17" title="VBA Makros in Excel einbinden - Standard Module" alt="VBA Makros in Excel einbinden 2" src="http://profi-excel.de/wp-content/uploads/2006/09/makroeinbinden2.jpg" /></p>
<p> Bild 3</p>
<p><img id="image18" title="VBA Makros in Excel einbinden - Code Fenster" alt="VBA Makros in Excel einbinden 3" src="http://profi-excel.de/wp-content/uploads/2006/09/makroeinbinden3.jpg" /></p>
<p>B.) <strong>Zum Einbinden von Makros in die Persönliche Makroarbeitsmappe</strong> gehen Sie genauso vor wie bei A.), nur dass Sie in der VBA-Projektübersicht (<em>Bild 1</em>) die Personl.xls auswählen. Falls diese noch nicht vorhanden ist, müssen Sie sich diese Datei erzeugen, in dem Sie ein Makro aufzeichnen, siehe <em>Bild 4</em>. Gehen Sie dazu in Excel (also nicht im Makro Editor) auf den Menüpunkt <strong>Extras - Makro - Aufzeichnen</strong> und zeichnen Sie eine beliebige Aktion, z.B. die Eingabe einer Zahl als Makro in der Personl.xls auf. Danach sollte die Personl.xls in der VBA-Projektübersicht erscheinen.</p>
<p> Bild 4 </p>
<p><img id="image19" title="VBA Makros in Excel einbinden - Makro aufzeichnen, persönliche Makroarbeitsmappe, personl.xls, personal.xls" alt="VBA Makros in Excel einbinden 4" src="http://profi-excel.de/wp-content/uploads/2006/09/makroeinbinden4.jpg" /></p>
<p>C.) Für das <strong>Abspeichern eines Makros in einem Add-In</strong> müssen Sie genau so vorgehen wie bei A.), nur, dass Sie die Datei nicht als normale Excel Datei mit der Endung .xls abspeichern, sondern über den Menüpunkt <strong>Datei - Speichern unter - Dateityp: Microsoft Excel-Add-In(*.xla) </strong>die Datei als Add-In abspeichern.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/makros-einbinden.htm/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Mehrfach Suchen und Ersetzen</title>
		<link>http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen.htm</link>
		<comments>http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen.htm#comments</comments>
		<pubDate>Thu, 21 Sep 2006 20:21:36 +0000</pubDate>
		<dc:creator>Eike</dc:creator>
				<category><![CDATA[VBA Makros]]></category>

		<guid isPermaLink="false">http://profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen.htm</guid>
		<description><![CDATA[In den beiden Arrays können die korresponierenden Begriffe eingetragen werden. Momentan werden die Buchstaben a durch 1, b durch 2, usw. ersetzt. Die Inhalte in den Arrays müssen natürlich den Bedürfnissen angepasst werden. Durch die For-Schleife werden die jeweiligen Einträge des Arrays der Replace-Methode des Range-Objekts übergeben. Das Range-Objekt stellt hier den benutzten Bereich des [...]]]></description>
			<content:encoded><![CDATA[<p>In den beiden Arrays können die korresponierenden Begriffe eingetragen werden. Momentan werden die Buchstaben a <span id="more-15"></span>durch 1, b durch 2, usw. ersetzt. Die Inhalte in den Arrays müssen natürlich den Bedürfnissen angepasst werden. Durch die For-Schleife werden die jeweiligen Einträge des Arrays der Replace-Methode des Range-Objekts übergeben. Das Range-Objekt stellt hier den benutzten Bereich des aktiven Tabellenblatts dar.</p>
<div class="igBar"><span id="lvba-20"><a href="#" onclick="javascript:showPlainTxt('vba-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">VBA:</span>
<div id="vba-20">
<div class="vba">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Sub</span> mehrfachSuchenUndErsetzen<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'sucht im aktiven Tabellenblatt jeweils die Eintraege aus</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'suchArray und ersetzt mit ersetzArray</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'09-2006</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #007F00;">'E.Bimczok http://profi-excel.de</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> suchArray<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> ersetzArray<span style="color:#000000; font-weight:bold;">&#40;</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Dim</span> k <span style="color: #00007F;">As</span> <span style="color: #00007F;">Long</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">suchArray = <span style="color: #00007F;">Array</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"a"</span>, <span style="color: #000000;">"b"</span>, <span style="color: #000000;">"c"</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ersetzArray = <span style="color: #00007F;">Array</span><span style="color:#000000; font-weight:bold;">&#40;</span><span style="color: #000000;">"1"</span>, <span style="color: #000000;">"2"</span>, <span style="color: #000000;">"3"</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">For</span> k = <span style="color: #00007F;">LBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span> <span style="color: #00007F;">To</span> <span style="color: #00007F;">UBound</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #00007F;">Call</span> ActiveSheet.<span style="color: #000000;">UsedRange</span>.<span style="color: #000000;">Replace</span><span style="color:#000000; font-weight:bold;">&#40;</span>suchArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                     ersetzArray<span style="color:#000000; font-weight:bold;">&#40;</span>k<span style="color:#000000; font-weight:bold;">&#41;</span>, _</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                     , _</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                     , _</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                     <span style="color: #00007F;">False</span><span style="color:#000000; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">Next</span> k</div>
</li>
<li style="font-weight: bold;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#000000;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #00007F;">End</span> <span style="color: #00007F;">Sub</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.profi-excel.de/vba_makros/mehrfach-suchen-und-ersetzen.htm/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

