Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why is the code below giving me the wrong answer. In the formula line, if I
just use J1 I get the right answer. When I use var1 (which is set as J1), it gives the wrong answer. ??? Private Sub CommandButton1_Click() Dim Ans1 As Range Dim var1 As Range Dim WS As Worksheet Set WS = Worksheets("Sheet1") Set Ans1 = WS.Range("h2") Set var1 = WS.Range("J1") Ans1.Value = Worksheets("sheet1").Evaluate("=SUMPRODUCT((A1:A10 ="" & var1 & "")*(B1:B10=k1))") End Sub -- Thanks Shawn |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code problem | Excel Discussion (Misc queries) | |||
VB Code Problem | Excel Discussion (Misc queries) | |||
Little problem with this code... | Excel Discussion (Misc queries) | |||
Problem with Code Below | Excel Programming | |||
Code problem | Excel Programming |