Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The macro I've written, basically adds shipping to a parts ordered. I've got
the user form to locae a particular order number and add the shipping accordingly, however, it only adds to the first value located, if i have multiple parts listed under the same order number, it doesn't find them. heres the macro as it stands now. Private Sub cmdAdd_Click() Dim Order As String Dim Index As Variant Dim nextrow As Long Dim myRng As Range Order = Me.txtOrder.Value ' Only looking in column K, so only look in column k Set myRng = Range("k:k") nextrow = Range("k65536").Row + 1 Index = Application.Match(CLng(Order), myRng, 0) If IsError(Index) Then MsgBox "Not Found, check Order No. and try again" Else myRng(Index).Select ActiveCell.Offset(0, -9).Value = ActiveCell.Offset(0, -9).Value + (Me.txtShip.Value / Me.txtPart.Value) End If Me.txtOrder.Value = "" Me.txtShip.Value = "" Me.txtPart.Value = "" Me.txtOrder.SetFocus End Sub -- --Chip Smith-- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
editing multiple cells with a macro | Excel Discussion (Misc queries) | |||
how to make a macro to clear multiple cells from multiple worksheets? | Excel Worksheet Functions | |||
macro copy/paste data from multiple cells to multiple cells | Excel Discussion (Misc queries) | |||
Inputbox macro for multiple cells | Excel Discussion (Misc queries) | |||
Recording macro for multiple cells | Excel Programming |