PC Review


Reply
Thread Tools Rate Thread

adding colors, patterns, comments to large spreadsheets in bulk

 
 
DB042188
Guest
Posts: n/a
 
      9th Apr 2008
Never looked at vba/excel before, but was able to reduce run time on an app
by 75% via recorset streamlining.

Still not happy with run times, learned that manipulation of cells is
consuming most of the other 25%.

Learned that perhaps adding values in bulk to spreadsheet (rather than one
by one) would probably improve performance drastically.

So I'm wondering if the pretty substantial color, pattern and comment
manipulation we're also doing can somehow be applied in bulk, perhaps from an
array or similar workaround?


 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      9th Apr 2008
Have a look at this sample code from Dave Peterson.

Sub ColorFormulas2()
'work on an entire range without For Each.........Next
Dim rng As Range

Set rng = Nothing
On Error Resume Next 'just in case there are no formulas
Set rng = Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0

If rng Is Nothing Then
'do nothing
Else
rng.Interior.Color = vbYellow
End If
End Sub


Gord Dibben MS Excel MVP

On Wed, 9 Apr 2008 05:58:04 -0700, DB042188 <(E-Mail Removed)>
wrote:

>Never looked at vba/excel before, but was able to reduce run time on an app
>by 75% via recorset streamlining.
>
>Still not happy with run times, learned that manipulation of cells is
>consuming most of the other 25%.
>
>Learned that perhaps adding values in bulk to spreadsheet (rather than one
>by one) would probably improve performance drastically.
>
>So I'm wondering if the pretty substantial color, pattern and comment
>manipulation we're also doing can somehow be applied in bulk, perhaps from an
>array or similar workaround?
>


 
Reply With Quote
 
DB042188
Guest
Posts: n/a
 
      9th Apr 2008
I can give that a whirl but isnt the idea to source the color, pattern etc
decision from something not already in cells, which from my understanding is
the reason for poor performance in the first place?

What about comments, can I source them from an array similar to the way in
which I'll try to source values from an array?

"Gord Dibben" wrote:

> Have a look at this sample code from Dave Peterson.
>
> Sub ColorFormulas2()
> 'work on an entire range without For Each.........Next
> Dim rng As Range
>
> Set rng = Nothing
> On Error Resume Next 'just in case there are no formulas
> Set rng = Cells.SpecialCells(xlCellTypeFormulas)
> On Error GoTo 0
>
> If rng Is Nothing Then
> 'do nothing
> Else
> rng.Interior.Color = vbYellow
> End If
> End Sub
>
>
> Gord Dibben MS Excel MVP
>
> On Wed, 9 Apr 2008 05:58:04 -0700, DB042188 <(E-Mail Removed)>
> wrote:
>
> >Never looked at vba/excel before, but was able to reduce run time on an app
> >by 75% via recorset streamlining.
> >
> >Still not happy with run times, learned that manipulation of cells is
> >consuming most of the other 25%.
> >
> >Learned that perhaps adding values in bulk to spreadsheet (rather than one
> >by one) would probably improve performance drastically.
> >
> >So I'm wondering if the pretty substantial color, pattern and comment
> >manipulation we're also doing can somehow be applied in bulk, perhaps from an
> >array or similar workaround?
> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Colors and/or Patterns in the Same Line billbrandi Microsoft Excel Charting 0 13th Jun 2009 02:43 AM
more colors for patterns Mark G. Microsoft Excel Discussion 1 12th Jan 2006 10:05 AM
Dynamically changing colors and patterns in a chart =?Utf-8?B?TUZI?= Microsoft Access 2 26th Aug 2005 06:16 PM
Can you recommend a book about design patterns? (factory patterns, singleton patterns etc) Joakim Olesen Microsoft Dot NET 4 4th Jan 2005 07:17 AM
Adding colors and comments to reply's Howard Microsoft Outlook 1 1st Jun 2004 12:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:31 AM.