When I run my macro, the screen updates to different tabs even though I have set Application.ScreenUpdating = False:
Code
Sub update_metro_2()
Application.ScreenUpdating = False
main_sheet = "By Sector and Industry"
second_sheet = "By Sector"
third_sheet = "By Industry"
ThisWorkbook.Sheets(second_sheet).DropDowns("cmb_metro_2") = ThisWorkbook.Sheets(main_sheet).DropDowns("cmb_metro").ListIndex
ThisWorkbook.Sheets(third_sheet).DropDowns("cmb_metro_3") = ThisWorkbook.Sheets(main_sheet).DropDowns("cmb_metro").ListIndex
Call paste_values_sectors
Call paste_values_industries
End Sub
Sub paste_values_sectors()
main_sheet = "By Sector and Industry"
second_sheet = "By Sector"
third_sheet = "By Industry"
top_row_source = 19
bottom_row_source = 38
left_column_source = 12
right_column_source = 17
top_row_dest = 9
left_column_dest = 3
ThisWorkbook.Sheets("UI Data").Range(Sheets("UI Data").Cells(top_row_source, left_column_source), Sheets("UI Data").Cells(bottom_row_source, right_column_source)).Copy
ThisWorkbook.Sheets(second_sheet).Cells(top_row_dest, left_column_dest).PasteSpecial xlPasteValues
End Sub
Sub paste_values_industries()
main_sheet = "By Sector and Industry"
second_sheet = "By Sector"
third_sheet = "By Industry"
bottom_row_source = ThisWorkbook.Sheets("UI Data").Range("X17").Value
top_row_source = 19
left_column_source = 22
right_column_source = 27
top_row_dest = 9
left_column_dest = 3
ThisWorkbook.Sheets("UI Data").Range(Sheets("UI Data").Cells(top_row_source, left_column_source), Sheets("UI Data").Cells(bottom_row_source, right_column_source)).Copy
ThisWorkbook.Sheets(third_sheet).Cells(top_row_dest, left_column_dest).PasteSpecial xlPasteValues
obj = ThisWorkbook.Sheets(third_sheet).Range("C9", "H187").sort(ThisWorkbook.Sheets(third_sheet).Range("F8"), xlDescending)
End Sub
Display More