title: How to write Pythagoras formula in excel VBA, like I need to select all the values of column A and column B
body: <pre><code>Sub MS()    
  
  Data = Sheets(&quot;Tabelle1&quot;).Select   
  Rows(&quot;1:1&quot;).Select
  Rows(&quot;11409:11409&quot;).Select
  
  Dim bilder As Long
  Dim n As Long
  Dim d As Long
  Dim t As Long
  
  bilder = 64
  n = 1    
  d = 0
  t = 0
  
  'Dim i As Long   
  
  'For i = 1 To lastrow
  
  Range(&quot;a1:a&quot; &amp; Cells(Rows.Count, 1).End(xlUp).Row).Select
  
  Range(&quot;b1:b&quot; &amp; Cells(Rows.Count, 1).End(xlUp).Row).Select
  
  'Range(&quot;a1&quot;).Select
  
  'Range(&quot;b1&quot;).Select
  
  Range(&quot;a1,b1&quot;).Select
  
  Do While ActiveCell.Value &lt;&gt; &quot;&quot;       
      Radius = Sqr(Range(&quot;A1&quot;).Value * Range(&quot;A1&quot;).Value + Range(&quot;B1&quot;).Value * Range(&quot;B1&quot;).Value)      
      ActiveCell.Offset(1, 1).Select 
  Loop    
  
  End Sub
  </code></pre>