Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply formula to a range with multiple selections
I'm trying to apply a formula to a range that a user can select.
Basically I have a user form where the user can select a range of data to be processed as well as an output cell where there the converted/processed range is put. Once the input ranges and output cell has been chosen I need to apply a formula to every cell in the input range and put it in the output cell. I have been successful in doing this where the input range is only a single selection but have been unable to get it to work with more multiple selections as the input range. Here is my code: Dim r As Range Dim r2 As Range ' Input and output ranges in userform Set r = Range(refInput.Value) Set r2 = Range(refOutput.Value) r.Copy r2.PasteSpecial Paste:=xlPasteValues Selection.SpecialCells(xlConstants).Formula = "--- formula goes here ---" ' Get rid of formulas so user does not see them. Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues Any way to get my code to work with multiple selections. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to get range names to Apply across multiple tabs | Excel Worksheet Functions | |||
How do I apply a formula to multiple rows at the same time? | Excel Worksheet Functions | |||
Apply autofilter selections to 2nd table automatically? Macro? | Excel Worksheet Functions | |||
Creating Multiple GIFs from Multiple Range selections -- I need a volunteer to test my code to see why it fails | Excel Programming | |||
apply a formula to multiple cells | Excel Discussion (Misc queries) |