Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
In message of Mon, 6 Jan 2014 13:08:59 in
microsoft.public.excel.worksheet.functions, GS writes For clarity, to resist my 'force-of-habit' the entire procedure need not have events disable as Claus's 3rd post holds true... [snip] My thanks to both GS and Claus Busch for their valuable thoughts. Eventually, I decided to write a VBA procedure to fill a column and embolden parts of the cells. At first, I had a loop which did both. That was unhelpful. Suppose I concatenate strings "A", "B" and "C" in that order and decide to embolden "B" with code like Cells(y, x).Characters(Start:=2, Length:=1).Font.Bold = True. When "C" is concatenated, it is also emboldened as the appended characters copy the bold attribute from that "B". I then found my code slow: about 130 seconds for 1300 rows. I carefully simplified the code with no noticeable result. I then googled excel vba optimisation. The first 2 hits were <www.cpearson.com/excel/optimize.htm and <http://www.ozgrid.com/VBA/SpeedingUpVBACode.htm Chuck Pearson's site is a gold mine and the Ozgrid site looks useful. I tried bracketing code with Application.Calculation = xlCalculationManual and Application.Calculation = xlCalculationAutomatic and with Application.ScreenUpdating = False and Application.ScreenUpdating = True The result is that my code runs in 1 to 2 seconds. That is fast enough. I can't publish as the data is confidential. -- Walter Briscoe --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Merging Book Lists That Are In Different Formats | Excel Worksheet Functions | |||
merging cells and eliminating spaces for empty cells | Excel Discussion (Misc queries) | |||
merging cells together but keeping all data from the cells | Excel Discussion (Misc queries) | |||
"Too Many Cell Formats" when merging files | Excel Programming | |||
Can you retain different text formats when merging text? | Excel Discussion (Misc queries) |