dave3009

Mohannd

May 4th, 2020
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub Update1_Click()
  2. Dim dLst As Long ' last cell in destination
  3. Dim sLst As Long ' last cell in source
  4. Dim sSh As Worksheet ' source sheet
  5. Dim dSh As Worksheet ' destination sheet
  6.  
  7. Set sSh = Sheets("Sheet6") ' set the source sheet
  8. Set dSh = Sheets("Sheet2") ' set the detination sheet
  9.  
  10. dLst = dSh.Range("B" & Rows.Count).End(xlUp).Row + 1 ' find the next available row in destination
  11. sLst = dSh.Range("C" & Rows.Count).End(xlUp).Row ' find end of source data
  12.  
  13. ' set the value of the next available range in destination to data in source
  14. dSh.Cells(dLst, 2).Resize(sLst, 9).Value = sSh.Cells(30, 3).Resize(sLst, 9).Value
  15.  
  16. End Sub
Add Comment
Please, Sign In to add comment