title: In VBA Given an input box value, write a program that changes the font to italic for cells in a range below the given value
body: <p>I've gotten fairly confused on this problem. The question as stated above asks you to write a program that gives an input box where you may enter a cutoff level. Once the cutoff level is given all values in the range on the sheet below that cutoff level need to be italicized. Where I get stuck is making the code select cells, not the whole range. Any suggestions?</p>
  
  <h2>Assignment</h2>
  
  <p>The file Sales.xlsx contains sales data of a firm for its different regions in a given month. Write a macro that italicizes and changes the font color to blue for the months Region 8 had sales less than a cutoff level provided by the user in an InputBox. For example, if the user enters 10000 in the InputBox, the macro should search for the months where sales in Region 8 are less than 10000. Then, the macro should turn cells E9, F9, I9, J9, K9, and L9 to italic with blue font</p>
  
  <h2>My attempt</h2>
  
  <pre><code>Sub Homework7Problem2() 
  ' Keyboard Shortcut: Ctrl+b 
  Dim Cutoff As String 
  Cutoff = InputBox("Enter the cutoff level you would like to use", "CutoffLevel")
  If Range("B2:M41").Cells &lt; CutoffLevel Then 
      Range("B2:M41").Cells.Font.Italic = True 
      With Selection.Font 
          .Color = -4165632 
          .TintAndShade = 0 
      End With 
  End If 
  End Sub
  </code></pre>