title: Cloning Objects in VBA?
body: <p>Is there a generic way to clone objects in VBA? So that i could copy x to y instead of copying just the pointer?</p>
  
  <pre><code>  Dim x As New Class1
    Dim y As Class1
  
    x.Color = 1
    x.Height = 1
  
    Set y = x
    y.Color = 2
  
    Debug.Print "x.Color=" &amp; x.Color &amp; ", x.Height=" &amp; x.Height
  </code></pre>
  
  <p>By generic i mean something like <code>Set y = CloneObject(x)</code> rather than having to create my own method for the class copying its properties one by one.</p>