Please can someone help me improve my VBA code below?
I'm teaching myself VBA and I've written a macro that works but I want to learn how to improve the code so the macro runs quicker. One part of the code that is slow is a creation of a temporary list that needs to be created on a temporary sheet, once the macro is completed the sheet has to deleted, so I can't store the list anywhere.
When the macro runs, the strings are entered one at a time and it takes a while to complete the long list. I've searched the web and I can't find anything to speed up this part, the quickest way I've found is using 'Step Into' on the VBA editor by quickly pressing F8. Pressing F8 really quickly makes this part of the macro run really fast but of course this isn't a viable option.
Below is an extract (S1 is the list's heading):
'In column S this list is created
Range("S1") = "Task Type"
Range("S2") = "Approval"
Range("S3") = "Approval"
Range("S4") = "Approval"
Range("S5") = "Approval"
Range("S6") = "Approval"
Range("S7") = "Approval"
Range("S8") = "Approval"
Range("S9") = "Approval"
Range("S10") = "Approval"
Range("S11") = "Task"
Range("S12") = "Task"
Range("S13") = "Task"
Range("S14") = "Task"
Range("S15") = "Task"
Range("S16") = "Task"
Range("S17") = "Task"
Range("S18") = "Task"
Range("S19") = "Task"
If anyone can teach me a quicker way I will really appreciate it and I will return to give thanks!
I'm teaching myself VBA and I've written a macro that works but I want to learn how to improve the code so the macro runs quicker. One part of the code that is slow is a creation of a temporary list that needs to be created on a temporary sheet, once the macro is completed the sheet has to deleted, so I can't store the list anywhere.
When the macro runs, the strings are entered one at a time and it takes a while to complete the long list. I've searched the web and I can't find anything to speed up this part, the quickest way I've found is using 'Step Into' on the VBA editor by quickly pressing F8. Pressing F8 really quickly makes this part of the macro run really fast but of course this isn't a viable option.
Below is an extract (S1 is the list's heading):
'In column S this list is created
Range("S1") = "Task Type"
Range("S2") = "Approval"
Range("S3") = "Approval"
Range("S4") = "Approval"
Range("S5") = "Approval"
Range("S6") = "Approval"
Range("S7") = "Approval"
Range("S8") = "Approval"
Range("S9") = "Approval"
Range("S10") = "Approval"
Range("S11") = "Task"
Range("S12") = "Task"
Range("S13") = "Task"
Range("S14") = "Task"
Range("S15") = "Task"
Range("S16") = "Task"
Range("S17") = "Task"
Range("S18") = "Task"
Range("S19") = "Task"
If anyone can teach me a quicker way I will really appreciate it and I will return to give thanks!