title: How do I remove the characters?
body: <p>How do I remove special characters and alphabets in a string ?</p>
  
  <pre><code> qwert1234*90)!  ' this might be my cell value
  </code></pre>
  
  <p>I have to convert it to </p>
  
  <pre><code> 123490  ' I mean I have to remove everything but keep only the numbers in string
  </code></pre>
  
  <p>but it should allow spaces !</p>
  
  <pre><code> qwe123 4567*. 90  ' String with spaces
   123 4567 90     ' output should be
  </code></pre>
  
  <p>I found the <a href="/questions/tagged/vba" class="post-tag" title="show questions tagged 'vba'" rel="tag">vba</a> <code>Replace</code> - but writing a replace for each character makes my code big. Well let me tell you clearly without hiding anything from you:</p>
  
  <p><ol>
  <li>input: <code>qwe123 4567*. 90</code>          ' String with spaces  cells(1,"A").value</li>
  <li>My idea to do these next:  <code>123 4567 90</code> ' remove characters first keeping white spaces</li>
  <li>final output  in <code>A1:A3</code></p>
  
  <blockquote>
    <p>123<br>
     4567<br>
     90     </li>
    </ol>
    <em>(for every space it should insert row and fill that)</em></p>
  </blockquote>
  
  <p>Could you tell me how do remove all characters except numbers and spaces in string?</p>
  
  <p>Thanks In advance</p>