PC Review


Reply
Thread Tools Rate Thread

Clear cell data using Combo Box

 
 
=?Utf-8?B?U2NvdHQgS2luZw==?=
Guest
Posts: n/a
 
      18th Jul 2007
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 With Quote
 
 
 
 
=?Utf-8?B?U2NvdHQgS2luZw==?=
Guest
Posts: n/a
 
      18th Jul 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
clear data and named cell greg Microsoft Excel Programming 12 19th Apr 2008 06:51 AM
Clear a set of combo boxes after a Submit of data to a new sheet. Jonah Microsoft Excel Worksheet Functions 0 3rd Mar 2008 12:05 AM
Macro to clear cell data without clearing headings =?Utf-8?B?RE9PR0lF?= Microsoft Excel Programming 3 19th Jul 2006 01:43 PM
clear combo data on add- [comboboxname].ItemData(n) not working =?Utf-8?B?RGlhbmFI?= Microsoft Access Forms 2 21st Feb 2006 04:39 PM
How can I clear all cell data EXCEPT formulas? Gregg Hill Microsoft Excel Discussion 1 21st Aug 2004 04:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:28 PM.