Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to remove cell data while inserting formulas in other cells upon a
selection in a drop-down control. Can someone point me an example or suggest changes to what I have? I can't seem to find an example in VB or Excel help. Thanks, Scott Private Sub ComboBox1_Change() With Worksheets(1).Shapes.AddFormControl(xlDropDown, _ Left:=10, Top:=10, Width:=100, Height:=10) .ControlFormat.DropDownLines = 10 If ComboBox1_Change() = False Then Range("G42").Select ActiveCell.FormulaR1C1 = "" Range("G43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-4])" Range("H42").Select ActiveCell.FormulaR1C1 = "" Range("H43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-5])" Range("I42").Select ActiveCell.FormulaR1C1 = "" Range("I43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-6])" Range("J42").Select ActiveCell.FormulaR1C1 = "" Range("J43").Select ActiveCell.FormulaR1C1 = "=R[-1]C/(SQRT(3)*RC[-7])" Range("J44").Select Else Range("G43").Select ActiveCell.FormulaR1C1 = "" Range("G42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-4]*R[1]C" Range("H43").Select ActiveCell.FormulaR1C1 = "" Range("H42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-5]*R[1]C" Range("I43").Select ActiveCell.FormulaR1C1 = "" Range("I42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-6]*R[1]C" Range("J43").Select ActiveCell.FormulaR1C1 = "" Range("J42").Select ActiveCell.FormulaR1C1 = "=SQRT(3)*R[1]C[-7]*R[1]C" End If End With End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to control drop down list width | Excel Worksheet Functions | |||
Cannot enter control for drop down box | Excel Worksheet Functions | |||
Drag & Drop file onto Userform control possible? | Excel Programming | |||
drag and drop without holding down control | Excel Programming | |||
Control on Sheet - Drop Down 1 | Excel Programming |