Hi,
I have a macro in a sheet that allows a user to hide some specific non-contiguous rows. It works, but is quite slow unfortunately. I assume there is a better way I can write the code to improve the speed. I am currently using this:
Sub Hide()
ActiveSheet.rows("16:17").Hidden = True
ActiveSheet.rows("19:20").Hidden = True
ActiveSheet.rows("22:23").Hidden = True
ActiveSheet.rows("27:28").Hidden = True
ActiveSheet.rows("30:31").Hidden = True
ActiveSheet.rows("33:33").Hidden = True
ActiveSheet.rows("35:35").Hidden = True
ActiveSheet.rows("38:39").Hidden = True
ActiveSheet.rows("41:41").Hidden = True
End Sub
Any suggestions on how to improve it? Currently takes about 5secs for all the rows to be hidden
Many thanks!!
I have a macro in a sheet that allows a user to hide some specific non-contiguous rows. It works, but is quite slow unfortunately. I assume there is a better way I can write the code to improve the speed. I am currently using this:
Sub Hide()
ActiveSheet.rows("16:17").Hidden = True
ActiveSheet.rows("19:20").Hidden = True
ActiveSheet.rows("22:23").Hidden = True
ActiveSheet.rows("27:28").Hidden = True
ActiveSheet.rows("30:31").Hidden = True
ActiveSheet.rows("33:33").Hidden = True
ActiveSheet.rows("35:35").Hidden = True
ActiveSheet.rows("38:39").Hidden = True
ActiveSheet.rows("41:41").Hidden = True
End Sub
Any suggestions on how to improve it? Currently takes about 5secs for all the rows to be hidden
Many thanks!!