Results 1 to 16 of 16

Thread: [RESOLVED]Macro Modification

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2010
    Posts
    42

    Post [RESOLVED]Macro Modification

    dear friend below macro work fine for me.only the thing is this macro final answer giving as a value.
    ex- =250-50=200
    this macro giving that final answer i mean 200.but i need answer like this =250-50
    when i click that cell it should =250-50 like this.not only =200
    pls any body can modify this macro.other whole thing in macro work very well.
    Code:
    Sub PackingToProductionUpdate()
    Dim LotFind As Range, Lots As Range, LotNum As Range
    Dim LotVal As Double
    Application.ScreenUpdating = False
    
    Set Lots = Sheets("Packing").Range("F5", Range("F" & Rows.Count).End(xlUp))
    On Error Resume Next
    
    For Each LotNum In Lots
        With Sheets("Production")
            Set LotFind = .Columns("K:K").Find(Left(LotNum, 6), After:=.Range("K" & Rows.Count), LookIn:=xlValues, _
                LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
    
            If Not LotFind Is Nothing Then
                LotVal = LotFind.Offset(0, -1).Value - LotNum.Offset(0, 1).Value
                    If LotVal <= 0 Then
                        LotFind.EntireRow.Delete xlShiftUp
                    Else
                        LotFind.Offset(0, -1).Value = LotVal
                    End If
                LotNum.EntireRow.ClearContents
                Set LotFind = Nothing
            End If
        End With
    Next LotNum
    
    Application.ScreenUpdating = True
    End Sub
    Last edited by johncena; Mar 22nd, 2010 at 06:44 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width