+ Reply to Thread
Results 1 to 2 of 2

macro works fine once than scrambles everything the second time

  1. #1
    Registered User
    Join Date
    11-29-2006
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2013
    Posts
    27

    macro works fine once than scrambles everything the second time

    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

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You are calling other macros that you have not included there code without this code we can not get the full picture.

    It would also help if you could post a copy of the workbook

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1