<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>VBA: If-Abfrage mit Werteliste</title>
    <link>http://forum.geizhals.at/feed.jsp?id=894789</link>
    <description>Geizhals-Forum</description>
    <item>
      <title>Re(2): VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7903964.html#7903964</link>
      <description>hab's mit If gemacht&lt;br/&gt;</description>
      <pubDate>Wed, 09 May 2018 09:33:26 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7903964.html#7903964</guid>
      <dc:creator>Infosauger</dc:creator>
      <dc:date>2018-05-09T09:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7903894.html#7903894</link>
      <description>hast dus mittlerweile gelöst?&lt;br/&gt;</description>
      <pubDate>Wed, 09 May 2018 05:44:37 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7903894.html#7903894</guid>
      <dc:creator>Thunder</dc:creator>
      <dc:date>2018-05-09T05:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7902680.html#7902680</link>
      <description>Quick&amp;Dirty-Version, wenn es um Ganzzahlen mit maximal 2 Stellen geht&lt;br&gt;IF Instr("02;11;12;81",Format(Eingabezahl,"0#")) = 0 THEN Echo Nix enthalten&lt;br&gt;&lt;br&gt;Wenn 3 Ziffern gebraucht werden: &lt;br&gt;IF Instr("002;011;012;081;678",Format(Eingabezahl,"00#")) = 0 THEN Echo Nix enthalten&lt;br&gt;&lt;br&gt;Wenn es nur um eine Ziffer geht:&lt;br&gt;IF Instr("2;5;7;9",Eingabezahl) = 0 THEN Echo Nix enthalten&lt;br&gt;&lt;br/&gt;</description>
      <pubDate>Thu, 03 May 2018 20:05:23 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7902680.html#7902680</guid>
      <dc:creator>Thing</dc:creator>
      <dc:date>2018-05-03T20:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7902676.html#7902676</link>
      <description>je nach anzahl der werte hast mehrere möglichkeiten:&lt;br&gt;&lt;br&gt;1) &lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;if wert &amp;lt;&amp;gt; wert1 and wert &amp;lt;&amp;gt; wert2 and ...&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;das wird recht bald unübersichtlich, vor allem, wenn sich zu wert1-wert5 irgendwann wert6, 7, 8... gesellt dann musst den code mehr als notwendig angreifen&lt;br&gt;&lt;br&gt;2) &lt;a href="https://excelmacromastery.com/vba-dictionary/" rel="noopener" target="_blank"&gt;https:/&lt;wbr/&gt;/&lt;wbr/&gt;excelmacromastery.com/&lt;wbr/&gt;vba-dictionary/&lt;wbr/&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;3) collection und mit contains prüfen&lt;br&gt;&lt;br&gt;4) wert1 - wertx in ein array hauen und dann durch loopen&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;&#xD;
arr_werte = array(wert1,wert2,...)&#xD;
&#xD;
b_kommtvor = false&#xD;
for i = lbond(arr_werte) to ubound(arr_werte) 'alternativ auch ohne zählvariable mit for each durchrattern&#xD;
  if arr_werte(i) = wert then&#xD;
     b_kommtvor = true&#xD;
     exit for&#xD;
  end if&#xD;
next i&#xD;
&#xD;
if b_kommtvor = true then ....&#xD;
&lt;/pre&gt;&lt;/div&gt;&lt;br/&gt;</description>
      <pubDate>Thu, 03 May 2018 19:43:49 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7902676.html#7902676</guid>
      <dc:creator>Thunder</dc:creator>
      <dc:date>2018-05-03T19:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7902677.html#7902677</link>
      <description>je nach anzahl der werte hast mehrere möglichkeiten:&lt;br&gt;&lt;br&gt;1) &lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;if wert &amp;lt;&amp;gt; wert1 and wert &amp;lt;&amp;gt; wert2 and ...&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;das wird recht bald unübersichtlich, vor allem, wenn sich zu wert1-wert5 irgendwann wert6, 7, 8... gesellt dann musst den code mehr als notwendig angreifen&lt;br&gt;&lt;br&gt;2) &lt;a href="https://excelmacromastery.com/vba-dictionary/" rel="noopener" target="_blank"&gt;https:/&lt;wbr/&gt;/&lt;wbr/&gt;excelmacromastery.com/&lt;wbr/&gt;vba-dictionary/&lt;wbr/&gt;&lt;/a&gt; &lt;br&gt;&lt;br&gt;3) collection und mit contains prüfen&lt;br&gt;&lt;br&gt;4) wert1 - wertx in ein array hauen und dann durch loopen&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;&#xD;
arr_werte = array(wert1,wert2,...)&#xD;
&#xD;
b_kommtvor = false&#xD;
for i = lbond(arr_werte) to ubound(arr_werte) 'alternativ auch ohne zählvariable mit for each durchrattern&#xD;
  if arr_werte(i) = wert then&#xD;
     b_kommtvor = true&#xD;
     exit for&#xD;
  end if&#xD;
next i&#xD;
&#xD;
if b_kommtvor = true then ....&#xD;
&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;edit:&lt;br&gt;5) das vorgeschlagene select case ist natürlich auch möglich und zumindest eine spur eleganter und auch praktischer als das reine if-konstrukt. würde aber für so eine prüfung weder if noch select nehmen.&lt;br/&gt;</description>
      <pubDate>Thu, 03 May 2018 19:43:49 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7902677.html#7902677</guid>
      <dc:creator>Thunder</dc:creator>
      <dc:date>2018-05-03T19:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7902625.html#7902625</link>
      <description>&lt;br&gt;&lt;div class=code&gt;&lt;pre&gt;&#xD;
Select Case Wert&#xD;
Case Wert1, Wert2, Wert3&#xD;
...&#xD;
End Select&#xD;
&lt;/pre&gt;&lt;/div&gt;&lt;br&gt;&lt;br/&gt;</description>
      <pubDate>Thu, 03 May 2018 13:09:14 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7902625.html#7902625</guid>
      <dc:creator>klausiw</dc:creator>
      <dc:date>2018-05-03T13:09:14Z</dc:date>
    </item>
    <item>
      <title>VBA: If-Abfrage mit Werteliste</title>
      <link>http://forum.geizhals.at/t894789,7902615.html#7902615</link>
      <description>Hallo,&lt;br&gt;&lt;br&gt;stehe gerade vor einem Problem: Ich möchte in einem Access Projekt in VBA mit einer if-Abfrage überprüfen, ob ein Wert nicht in einer Liste von Werten (keine Combox oder dgl.)&lt;br&gt;&lt;br&gt;Also in etwas so&lt;br&gt;if Wert not in (Wert1, Wert2, Wert3, ... , Wert10) then&lt;br&gt;end if&lt;br&gt;&lt;br&gt;gibt es sowas?&lt;br&gt;&lt;br&gt;&lt;br/&gt;</description>
      <pubDate>Thu, 03 May 2018 12:17:01 GMT</pubDate>
      <guid>http://forum.geizhals.at/t894789,7902615.html#7902615</guid>
      <dc:creator>Infosauger</dc:creator>
      <dc:date>2018-05-03T12:17:01Z</dc:date>
    </item>
  </channel>
</rss>
