Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub copythat()
- Dim first_row As Integer
- Dim last_row As Integer
- Dim main_wb As String
- Dim main_ws As String
- Dim final_ws As Worksheet
- main_wb = "свод прогнозов.xlsb"
- main_ws = "прогнозы"
- Set final_ws = Windows(main_wb).ActiveSheet
- With ActiveSheet
- first_row = .Cells(1, 1).End(xlDown).Row
- ActiveSheet.Cells(first_row, 1).Select
- Range(Selection, Selection.End(xlDown)).Select
- Range(Selection, Selection.End(xlToRight)).Select
- Selection.Copy
- End With
- With final_ws
- last_row = .UsedRange.Rows(.UsedRange.Rows.Count).Row
- .Cells(last_row, 1).PasteSpecial Paste:=xlPasteValues
- .Cells(last_row, 1).PasteSpecial Paste:=xlPasteFormats
- End With
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement