Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear cell data using Combo Box
I have a combo box with 2 selections. How can I clear data or a formula from
A1 while inserting a formula into A2. Additionaly, using the second selection, remove data or a formula from A2 while inserting a formula into A1. Help/Advice/direction greatly appreciated. Scott |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clear cell data using Combo Box
I've got the following working, but is there a way to do this without the
"Range("Cell").Select ? Also, how can I format the font color? Private Sub ComboBox4_Change() If ComboBox4 = "Enter kVA" Then Range("J43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-7])" Range("J42").Select ActiveCell.FormulaR1C1 = "0" Range("I43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-6])" Range("I42").Select ActiveCell.FormulaR1C1 = "0" Range("H43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-5])" Range("H42").Select ActiveCell.FormulaR1C1 = "0" Range("G43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-4])" Range("G42").Select ActiveCell.FormulaR1C1 = "0" Else Range("J42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-7]*R[1]C" Range("J43").Select ActiveCell.FormulaR1C1 = "0" Range("I42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-6]*R[1]C" Range("I43").Select ActiveCell.FormulaR1C1 = "0" Range("H42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-5]*R[1]C" Range("H43").Select ActiveCell.FormulaR1C1 = "0" Range("G42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-4]*R[1]C" Range("G43").Select ActiveCell.FormulaR1C1 = "0" End If End Sub Private Sub Worksheet_Activate() With Me.ComboBox4 .ListFillRange = "M30: M31" .ListIndex = 0 End With End Sub "Scott King" wrote: I have a combo box with 2 selections. How can I clear data or a formula from A1 while inserting a formula into A2. Additionaly, using the second selection, remove data or a formula from A2 while inserting a formula into A1. Help/Advice/direction greatly appreciated. Scott |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clear a set of combo boxes after a Submit of data to a new sheet. | Excel Worksheet Functions | |||
Clear entries on Combo box | Excel Discussion (Misc queries) | |||
Clear unactive combo boxes | Excel Programming | |||
Macro to clear combo box values | Excel Programming | |||
How to clear all item from a combo box? | Excel Programming |