Closed Thread
Results 1 to 2 of 2

code stops working after X rows.

Hybrid View

  1. #1
    colwyn
    Guest

    code stops working after X rows.

    I'm using Excel 2007 and my s/s is 360000 rows deep.
    To cut+paste formulas+formats from one column to another I'm using the following code:

    Sub move_formula_and_formats_from_I_to_L()
    
    Dim cell As Range
    
    Application.ScreenUpdating = False
    
    
    For Each cell In Range("I1", Cells(Rows.Count, "I").End(xlUp))
    With cell
    If .HasFormula And Not .Offset(1).HasFormula Then
    .Cut Destination:=.Offset(1, 3)
    End If
    End With
    Next cell
    
    Application.ScreenUpdating = True
    
    End Sub
    Each time the code is run it stops working after 159050 rows and highlights (in yellow) the line:
    .Cut Destination:=.Offset(1, 3)
    Can anyone help with this??

    Small XML attachment may help better understand.
    Big thanks.
    Colwyn.

    cross-post: http://www.mrexcel.com/forum/showthread.php?t=355116
    Last edited by colwyn; 11-24-2008 at 01:14 PM. Reason: Added code tags as per forum rules

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    colwyn,

    Please add the link to the other excel forum as cross post without the link is not permitted. Read the forum rules below before posting again

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

Closed 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