title: how to use selection cell range variables
body: <p>I want to make variable C into the selection cell</p>
  <p><a href="https://i.stack.imgur.com/cO3Ti.png" rel="nofollow noreferrer">like this</a>
  <a href="https://i.stack.imgur.com/rLaT6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rLaT6.png" alt="enter image description here" /></a></p>
  <p>Dim c= selection area
  I tried this code:
  ActiveCell.Value
  but doesnt' working..
  Selcetion cell is always change.. so can't use range(null:null)</p>
  <pre><code>Sub noname1()
  
  Dim wsCopy As Worksheet
  Dim wsDest As Worksheet
  Dim lCopyLastRow As Long
  Dim lDestLastRow As Long
  Dim B As String
  Dim C
  
    B = Cells(20, 87).Value
    C = Selection
    
    'Set variables for copy and destination sheets
    Set wsCopy = Workbooks(&quot;source.xlsx&quot;).Worksheets(&quot;5.588&quot;)
    Set wsDest = Workbooks(&quot;dest.xlsx&quot;).Worksheets(B)
    
    lCopyLastRow = wsCopy.Cells(wsCopy.Rows.Count, &quot;A&quot;).End(xlUp).Row
      
    'Offset property moves down 1 row
    lDestLastRow = wsDest.Cells(wsDest.Rows.Count, &quot;A&quot;).End(xlUp).Offset(1).Row
  
    wsCopy.Range(C).Copy _
      wsDest.Range(&quot;A&quot; &amp; lDestLastRow)
      
    'Optional - Select the destination sheet
    wsDest.Activate
  
  End Sub
  </code></pre>