title: Define variable for equation
body: <p>Hi there I have a code that checks through a column to see for any values >0 if there is it would copy paste that column to sheet one else it would just display a pop up message. </p>
  
  <p>Tried doing the code but I am unable to define <code>a</code> Hence i would need some help with that. Thanks in adv:) </p>
  
  <p>This is the code:</p>
  
  <pre><code>Option Explicit
  
  Sub TestPasteColumnData2()
  
      Dim lastrow As Long
      Dim i As Long
      lastrow = Cells(Rows.Count, "B").End(xlUp).Row
  
      For i = 4 To lastrow
      a = Cells(i, "C").Value
      If a &lt; 0 Then
  
       MsgBox ("No Value")
       Exit Sub
  
     Else
  
     Sheets("WF - L12 (3)").Columns(3).Copy Destination:=Sheets("Sheet1").Columns(3)
  
     End If
  
     Next
    MsgBox ("Done")
  End Sub
  
  Sub TestPasteColumnData3()
  
  Dim lastcol As Long
  Dim j As Long
  
      With Worksheets("WF - L12 (3)")
      lastcol = .Cells(4, Columns.Count).End(xlToLeft).Column
         For j = 3 To lastcol
          If CBool(Application.CountIfs(.Columns(j), "&gt;0")) Then
              .Columns(j).Copy Destination:=Worksheets("Sheet1").Columns(3)
          Else
              MsgBox ("No Value")
              Exit Sub
          End If
          Next
      End With
  
      MsgBox ("Done")
  End Sub
  </code></pre>