ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Script based on combobox selection (https://www.excelbanter.com/excel-programming/386579-vbulletin-script-based-combobox-selection.html)

gmac[_2_]

VB Script based on combobox selection
 
Hi

I have a combobox with various items like 2005, 2006, 2005 Q1,
2005Q2, Business. Combobox is called Combobox1 and in Sheet5

I have a common VB code .

ActiveSheet.Evaluate("SUM(IF($CU$7:$CU$4978=2006 ,IF($K$7:$K
$4978=""Accept-Create New Project"",$G$7:$G$4978,0),0))")

In the above code I have hardcoded it for 2006. But I need to change
the 2006 with what ever user selects in combobox.


Charles Chickering

VB Script based on combobox selection
 
ActiveSheet.Evaluate("SUM(IF($CU$7:$CU$4978=" & ComboBox1.Value & _
" ,IF($K$7:$K$4978=""Accept-Create New Project"",$G$7:$G$4978,0),0))")

--
Charles Chickering

"A good example is twice the value of good advice."


"gmac" wrote:

Hi

I have a combobox with various items like 2005, 2006, 2005 Q1,
2005Q2, Business. Combobox is called Combobox1 and in Sheet5

I have a common VB code .

ActiveSheet.Evaluate("SUM(IF($CU$7:$CU$4978=2006 ,IF($K$7:$K
$4978=""Accept-Create New Project"",$G$7:$G$4978,0),0))")

In the above code I have hardcoded it for 2006. But I need to change
the 2006 with what ever user selects in combobox.




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com