Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Dim excel As excel.Application
  2. Dim wsGET As String
  3. Dim wb As excel.Workbook
  4. Dim sht As excel.Worksheet
  5.  
  6.  
  7.  
  8. NewSheet.Activate
  9. Range("A1").Activate
  10. Range("A1") = ActiveWorkbook.Name
  11. Range("B1").Select
  12. ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],2)"
  13.  
  14. wsGET = ActiveSheet.Range("b1")
  15. Set wb = Workbooks.Open("C:Usersextosldvadocumentsvatcontrols.xlsx")
  16. Set sht = wsGET
  17.  
  18. sht.Activate
  19. sht.Range("A1:A3").Copy
  20. sht.Range("B1:B3").PasteSpecial Paste:=xlPasteValues
  21.  
  22. If Sheet.Name = wsGET Then
  23.  
  24.  
  25. Sheet.Activate
  26.  
  27. End If
  28.  
  29. Set Sheet = Sheets.Add
  30. Sheet.Name = targetSheetName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement