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

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