Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. Sub Macro2()
  2.  
  3. Dim Arow As Range
  4. Set Arow = Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)
  5. Dim Irow As Range
  6. Set Irow = Arow.Offset(0, 8)
  7.  
  8. Dim PreRangeToCopy As Range
  9. Set PreRangeToCopy = Range(Arow, Irow)
  10. Dim LastRangeToCopy As Range
  11. Set LastRangeToCopy = PreRangeToCopy.Offset(5, 0)
  12.  
  13. Dim Arowand As Range
  14. Set Arowand = Arow.End(xlDown)
  15. Dim Arowlast As Range
  16. Set Arowlast = Arow.End(xlDown).Offset(0, 8)
  17.  
  18. Workbooks("Update").Worksheets("17_koniunktur_ogolny_klimat wie").Activate
  19. ActiveSheet.ListObjects("3").Range.AutoFilter Field:=4, Criteria1:="10-49"
  20. Workbooks("Update").Activate
  21. Worksheets("17_koniunktur_ogolny_klimat wie").Select
  22. Range(Arowand, Arowlast).Copy
  23.  
  24. Windows("Master.xlsx").Activate
  25. Sheets("17_koniunktur_ogolny_klimat wie").Select
  26.  
  27. ' ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$I$141"), , xlYes).name = "TableA"
  28. 'Range("Table1[#All]").Select
  29.  
  30. ActiveSheet.ListObjects("TableA").Range.AutoFilter Field:=4, Criteria1:="10-49"
  31.  
  32. Arowand.Select
  33. Selection.EntireRow.Insert
  34.  
  35. Workbooks("Update").Worksheets("17_koniunktur_ogolny_klimat wie").Activate
  36. Range(Arowand, Arowlast).Copy
  37.  
  38. Workbooks("Master.xlsx").Worksheets("17_koniunktur_ogolny_klimat wie").Activate
  39. Arowand.Select
  40. ' Selection.Paste
  41.  
  42. Workbooks("Update").Worksheets("17_koniunktur_ogolny_klimat wie").Activate
  43. Range(Arowand, Arowlast).Offset(-5, 0).Copy
  44.  
  45. Workbooks("Master.xlsx").Worksheets("17_koniunktur_ogolny_klimat wie").Activate
  46. Arowand.Offset(-1, 0).PasteSpecial xlPasteValues
  47.  
  48.  
  49. 'Windows("Master.xlsx").Activate
  50. 'Worksheets("17_koniunktur_ogolny_klimat wie").Select
  51. 'Arow.Copy
  52. 'ActiveSheet.Paste
  53. 'Application.CutCopyMode = False
  54.  
  55. 'Dim move2 As Range
  56. 'Set move2 = LastRangeToCopy.Offset(0, 8)
  57. 'Workbooks("Update").Activate
  58. ' Worksheets("17_koniunktur_ogolny_klimat wie").Select
  59. 'LastRangeToCopy.Copy
  60. ' Application.CutCopyMode = False
  61. 'Selection.Copy
  62. '
  63. 'Windows("Master.xlsx").Activate
  64. 'Worksheets("17_koniunktur_ogolny_klimat wie").Select
  65. 'Arowand.Copy
  66. 'ActiveSheet.Paste
  67.  
  68. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement