i'm working with some else's macro and i dont know a lot about VBA but it pulls information from a worksheet in the same workbook and works fine the first time but if i press it again it scrambles everything and pulls the wrong things:
Public Sub Rollovers()
Dim cell As range
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Call Initialize("ROLL")
For Each cell In range("RemOptions")
If UCase(cell) = "NONE" Then
Call GetLeaseEnds(cell.Offset(0, -1), 0)
Call PlaceLeaseEnds(cell, "ROLL")
ElseIf UCase(cell) = "1 X 1" Then
Call GetLeaseEnds(cell.Offset(0, -1), 1)
Call PlaceLeaseEnds(cell, "ROLL")
ElseIf UCase(cell) = "2 X 1" Or UCase(cell) = "1 X 2" Then
Call GetLeaseEnds(cell.Offset(0, -1), 2)
Call PlaceLeaseEnds(cell, "ROLL")
ElseIf UCase(cell.Offset(0, 18).Value) = "MARKET" Then
Call GetLeaseEnds(cell.Offset(0, -1), 0)
Call PlaceLeaseEnds(cell, "ROLL")
End If
Next
Application.Calculation = xlCalculationAutomatic
Call HideRows("ROLLMTM")
Call HideRows("ROLL2006")
Call HideRows("ROLL2007")
Call HideRows("ROLL2008")
Call SortData("ROLL", 4)
ActiveSheet.range("o8").Select
Application.ScreenUpdating = True
Call DisplayIncorrectValues
Bookmarks