View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
T Lavedas T Lavedas is offline
external usenet poster
 
Posts: 38
Default combo boxes (swines)

On May 1, 10:54 am, Atishoo wrote:
Am trying to get a combo box to keep adding its selected contents to a cell
(actually to an offset cell) have used this sub successfully with a set list
fill range but as soon as I use a variable range it becomes circular and just
keeps adding and adding to itself etc! how do I make a cell = itself plus
another cell once only per combo box click?

Private Sub ComboBox54_Click()

With Worksheets("Main Board")

Set c = .Range("D82")

ActiveCell.Offset(c, 0).Value = Range("I86") + ActiveCell.Offset(c, 0).Value
Range("I86") = " "
End With

End Sub


Try saving the sum into an intermediate temporary value ...

Private Sub ComboBox54_Click()
Dim Newvalue, c
With Worksheets("Main Board")

Set c = .Range("D82")
Newvalue = Range("I86") + ActiveCell.Offset(c, 0).Value

ActiveCell.Offset(c, 0).Value = Newvalue
Range("I86") = ""
End With

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

End Sub