title: Merge consecutive cells referenced with variables only
body: <p>I want to merge 4 consecutive cells of a row in a VBA macro/module. However, I am only allowed to use the variables referencing the start cell and/or any other cell (of course, only the cells that need to be merged are of importance- the point being at any stage, I prefer not using the cell address since it is to be used in a Do-While loop, finally).</p>
  <p>I have tried multiple methods, but none return the desired merging. Here's what I tried (note- D is the variable for my referenced cell)</p>
  <pre><code>Range(D, D.Offset(0, 1)).merge
  Range(D &amp; D.Offset(0, 2)).merge
  Range(D &amp; D.Offset(0, 3)).merge
  </code></pre>
  <p>This one doesn't return an error but merges only two consecutive cells. On the other hand, the following one, I found it as a solution on multiple sites but it returns &quot;Run-time error: 1004 Method 'Range' of Object'_Global' failed&quot;, results in no merging and the loop ends prematurely.</p>
  <pre><code>Set E= D.Offset(0,3)
  Range(D &amp; &quot;:&quot; &amp; E).merge
  </code></pre>
  <p>D has been set and defined correctly as the loop works with the merge commands commented out. Have only started coding in VBA recently, any help would be great!</p>