Forum Discussion
waygar
Feb 15, 2023Brass Contributor
Speeding Up VBA execution
Hi, The following code searches a large database for cells with a certain fill color and then removes the underlying conditional formatting. The runtime is quite slow. Can this code be made more eff...
HansVogelaar
MVP
My version reads the data into an array, traverses the array and then writes the array back to the sheet in one go.
Array manipulations are much faster than sheet manipulations.
waygar
Mar 05, 2023Brass Contributor
Hi Hans,
Do you lose cell formatting in this approach when moving data in and out of arrays?
Do you lose cell formatting in this approach when moving data in and out of arrays?
- HansVogelaarMar 06, 2023MVP
- waygarMar 23, 2023Brass ContributorHi Hans,
How do I create a Userform that contains, among other things, a combo box that contains a list of dates with one date to select. The default date that is initially shown must be today's date and the dates that can be selected range from say 14 days before the default of today's date to 14 days ahead of today's date. Of course today's date will change eveyday. It would be preferable not to have this list in any worksheet if possible.- HansVogelaarMar 23, 2023MVP
Let's say you have a combo box DateCombo. In the userform's code module:
Private Sub UserForm_Initialize() Dim d As Date For d = Date - 14 To Date + 14 Me.DateCombo.AddItem d Next d Me.DateCombo = Date End Sub