Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I don't know how to insert two ranges in one inputbox but here is code for two
inputboxes. Sub InsertFormula() Dim rng1, rng2 As Range With ActiveSheet ..Names.Add Name:="rng1", RefersTo:=Application.InputBox(prompt:= _ "Select rng1", Type:=8) ..Names.Add Name:="rng2", RefersTo:=Application.InputBox(prompt:= _ "Select rng2", Type:=8) ActiveCell.Formula = "=sumproduct(--(rng1<0),rng2)" End With End Sub Gord Dibben MS Excel MVP On Fri, 29 Feb 2008 20:18:01 -0800, FARAZ QURESHI wrote: I have the following piece of code for inserting a formula on a shortcut key instead of typing the same manually. Sub InsertFormula() ActiveCell.Formula = "=sumproduct(--(a1:a10<0),b1:b10)" End Sub Any idea how to select the ranges: a1:a10 & b1:b10 via "Single" Input Box (like type:=8) with 2 fields for selecting the ranges? AND also via "Two" separate Input Boxes for the same purpose? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting check boxes | Excel Discussion (Misc queries) | |||
Inserting check boxes | Excel Discussion (Misc queries) | |||
drop boxes, entering input | Excel Discussion (Misc queries) | |||
Inserting check boxes | Excel Worksheet Functions | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) |