Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Sub Adding_New_Markets()
  2.  
  3. Dim SKA_Country_Column As Integer, Y_N_Column As Integer, Last_Tracker_Column As Integer, _
  4. CurrentRow As Integer, Last_Open_Row As Integer, Last_Tracker_Row As Integer, New_Market_Tracker As Range
  5.  
  6. SKA_Country_Column = 1
  7. Y_N_Column = 2
  8. Last_Tracker_Column = ThisWorkbook.Worksheets("Markets to Open").UsedRange.Columns.Count
  9. Last_Open_Row = ThisWorkbook.Worksheets("Markets to Open").UsedRange.Rows.Count
  10. Last_Tracker_Row = ThisWorkbook.Worksheets("Market Tracker").UsedRange.Rows.Count
  11. Set New_Market_Tracker = ThisWorkbook.Worksheets("Market Tracker Template").Range("A1:T1")
  12.  
  13. Do While SKA_Country_Column <= Last_Tracker_Column
  14. If ThisWorkbook.Worksheets("Markets to Open").Cells(1, SKA_Country_Column).Value = "SKA" Then
  15. New_Market_Tracker.Copy Sheet6.Range("A1").Offset(Last_Tracker_Row, 0)
  16. End If
  17. Do While Y_N_Column <= Last_Open_Row
  18. With ThisWorkbook.Worksheets("Markets to Open")
  19. If .Cells(1, Y_N_Column).Value = "Yes" Then
  20. Sheet6.Cells(Last_Tracker_Row + 1, 1).Value = .Cells(1, Y_N_Column - 1).Value
  21. End If
  22. End With
  23. Y_N_Column = Y_N_Column + 1
  24. Loop
  25. SKA_Country_Column = SKA_Country_Column + 1
  26. Last_Tracker_Row = Last_Tracker_Row + 1
  27. Loop
  28.  
  29. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement