Results 1 to 5 of 5

my code delete all the rows

Threaded View

  1. #1
    Registered User
    Join Date
    05-13-2011
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    49

    my code delete all the rows

    here is my code for cut a row upon value of specific cell then paste it in other sheet then delete the cutted row but when it execute it delete all the rows not the cutted one only

    Sub fail()
    Dim my   As Long
    For my = 2 To 65536
           If Cells(my, "O").Value = "11" Then
           Rows(my).Cut
           Sheet1.Activate
           NextRow = Sheet1.Range("A65536").End(xlUp).Row + 1
           Sheet1.Range("A" & NextRow).Insert
           Sheet2.Rows(my).Delete
    End If
       Next my
    End Sub
    Last edited by suny100; 05-17-2011 at 02:36 PM.

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