View Single Post
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

Rob -

One quick way around this is to give you collection of cells a name, say
FormulaRange. Then use code like this instead of wht you've got

Dim rng as Range
Application.Screenupdating = false
For Each rng in Range("FormulaRange")
rng.select
rng.formula = "=ITNBudgetFormula"
rng.Copy
rng.PasteSpecial xlvalues
Next rng
Application.Screenupdating = true

Duke

"Rob" wrote:

I'm trying to select a series of ranges to
1. paste a named formula I've created and then
2. remove the formula & leave the value

What I have so far is shown below, but I'm sure there must be a better way.
The problem seems to be that I can't use the copy function in a multiple
range. I guess I can't paste xlValues to multiple ranges either, so I'm
being forced to handle each range, one at a time, which seems rather
cumbersome.

Sub Macro1()
Range("G8:R45,G50:R59,G63:R110,G114:R121,G114:R122 ,G126:R134").Select
Selection = "=ITNBudgetFormula"
Range("G8:R45").Select
Range("G8:R45").Copy
Selection.PasteSpecial Paste:=xlValues
Range("G50:R59").Select
Range("G50:R59").Copy
Selection.PasteSpecial Paste:=xlValues
'etc for the rest of the range
End Sub