View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Smith Chip Smith is offline
external usenet poster
 
Posts: 10
Default Dispersing a value over multiple cells using a macro

thank you...that worked great!

--
--Chip Smith--



"stevebriz" wrote:

try this out and see it works for you

Private Sub CommandButton1_Click()
Dim Order As String
Dim Index As Variant
Dim nextrow As Long
Order = txtorder.Value


With Worksheets(1).Range("K:K")
Set c = .Find(Order, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
Cells(c.Row, 2).Value = Cells(c.Row, 2).Value +
(Me.txtShip.Value / Me.txtPart.Value)

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

End Sub