title: VBA: Clear multiple discontiguous cells
body: <p>I have the following code right now: </p>
  
  <pre><code>Sub ClearTimeline()
      Dim wsTimeline As Worksheet
      Set wsTimeline = ThisWorkbook.Sheets(1)
  
      wsTimeline.Range("B8, F25, F26, F28, F30, M17, M31, L17, L24:L25, L26, L28, L29:L30, J24:J25, J26, J28, J29:J30, K25, K26, K28, K30").ClearContents
  
  End Sub
  </code></pre>
  
  <p>I want to replace the fixed cell reference by something more dynamic. The rows won't change, so I want to change how I reference the columns. I have a "reference cell", i.e. a cell I can always find/know the column of. </p>
  
  <pre><code>Sub ClearTimeline()
      Dim wsTimeline As Worksheet
      Dim referenceDay As Long
  
      Set wsTimeline = ThisWorkbook.Sheets(1)
      referenceDay = 10
  
  'what works:
      wsTimeline.Range(wsTimeline.Cells(referenceDay - 9, 1)).ClearContents 'clears single cell
  
      wsTimeline.Range(wsTimeline.Cells(referenceDay - 9, 1), wsTimeline.Cells(referenceDay - 1, 1)).ClearContents 'clears range
  
  End Sub
  </code></pre>
  
  <p>My goal is to refer to every column as 'referenceDay +/- X' because the distance to this day will stay the same even if the sheet is altered in some other way. But how do I tell Excel to do the same action for non-contiguous cells? I'm not sure how to reference them and what to put into the parentheses after <code>wsTimeline.Range</code></p>