Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim excel As excel.Application
- Dim wsGET As String
- Dim wb As excel.Workbook
- Dim sht As excel.Worksheet
- NewSheet.Activate
- Range("A1").Activate
- Range("A1") = ActiveWorkbook.Name
- Range("B1").Select
- ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],2)"
- wsGET = ActiveSheet.Range("b1")
- Set wb = Workbooks.Open("C:Usersextosldvadocumentsvatcontrols.xlsx")
- Set sht = wsGET
- sht.Activate
- sht.Range("A1:A3").Copy
- sht.Range("B1:B3").PasteSpecial Paste:=xlPasteValues
- If Sheet.Name = wsGET Then
- Sheet.Activate
- End If
- Set Sheet = Sheets.Add
- Sheet.Name = targetSheetName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement