title: How to set Column as a variable
body: <p>is it possible to set a column as an variable ? like setcolumn = B ? Because I had a vba code which help me create conditional formatting, however, everday i would need to change the column but the range stays the same. Based on my code below, i would need to change I2:I146 to J2:J146 and so on... everyday... Thus, i would like to know if its possible to set the column to a variable. </p>
  
  <p>CURRENT CODE</p>
  
  <pre><code>Sub Button6_Click()
  Dim ws As Worksheet
  Dim i As Integer
  Set ws = Sheets("COMPARISON")
  i = 1
  
  With Range("I2:I146").FormatConditions.Add( _
      Type:=xlExpression, _
      Formula1:="=((($I2-$E2)/$E2)*100) &gt; 20")
      .Interior.Color = RGB(255, 0, 0)
  
  End With
  
  With Range("I2:I146").FormatConditions.Add( _
      Type:=xlCellValue, _
      Operator:=xlEqual, _
      Formula1:="0")
      .Interior.Color = RGB(0, 0, 0)
      .Font.Color = RGB(255, 255, 255)
  End With
  
  With Range("I2:I146").FormatConditions.Add( _
      Type:=xlExpression, _
      Formula1:="=AND($I2&lt;$E2, $I2&lt;&gt;0)")
      .Interior.Color = RGB(255, 255, 0)
  End With
  
  Do Until i = 300
     If ws.Range("I" &amp; i).DisplayFormat.Interior.Color = RGB(255, 0, 0) Then
         msg = "I" &amp; i &amp; " -" &amp; " Data has INCREASED"
         MsgBox msg
     ElseIf ws.Range("I" &amp; i).DisplayFormat.Interior.Color = RGB(0, 0, 0) Then
         msg1 = "I" &amp; i &amp; " -" &amp; " Data is ZERO"
         MsgBox msg1
     ElseIf ws.Range("I" &amp; i).DisplayFormat.Interior.Color = RGB(255, 255, 0)       Then
     msg2 = "I" &amp; i &amp; " -" &amp; " Data is DECREASED"
     MsgBox msg2
  End If
  i = i + 1
  Loop
  
  End Sub
  </code></pre>