Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Drop-down control

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to control drop down list width DocBrown Excel Worksheet Functions 4 March 17th 09 06:03 PM
Cannot enter control for drop down box Ken Excel Worksheet Functions 2 October 5th 07 02:00 PM
Drag & Drop file onto Userform control possible? Mike Iacovou Excel Programming 2 February 16th 07 06:32 PM
drag and drop without holding down control Munson Excel Programming 2 December 6th 06 08:16 AM
Control on Sheet - Drop Down 1 Arturo Excel Programming 2 April 25th 05 04:42 PM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"