+ Reply to Thread
Results 1 to 7 of 7

Moving a row to another sheet and deleting the empty row

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Moving a row to another sheet and deleting the empty row

    Hi all,

    I posted a question yesterday and received an excellent answer within minutes!

    I now have a macro question.

    After searching, I found the below code written by arlu1201 and it worked brilliantly, but when I amended the details to suit my sheet, the code works, but has a error come up saying Run time error 13, type mismatch.

    I dont know what I have done wrong as all the words match including case size....

    Sheet 1 - Column one can be changed to either active or returned. If Returned, then the row moves to the Returned Vans sheet and empty row on sheet 1 is deleted.

    Link to thread: http://www.excelforum.com/excel-prog...-down-box.html

    Code: Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 1 Then
    If Target.Value = "Returned" Then
    Target.EntireRow.Copy Worksheets("Returned Vans").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
    Target.EntireRow.Delete
    End If
    End If
    End Sub

    Any helps is appreciated.

    thank you in advance.

  2. #2
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Moving a row to another sheet and deleting the empty row

    I dont know why you are getting that error, but i just tried the on error function and now it works find for me.

    try this code..
    Please Login or Register  to view this content.
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

  3. #3
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Moving a row to another sheet and deleting the empty row

    I dont know why you are getting that error, but i just tried the on error function and now it works find for me.

    try this code..
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-18-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Moving a row to another sheet and deleting the empty row

    Thanks Raga.

    Bizzare now the macro doesnt work at all? macros is enabled but the row doesnt move at all when changed to "Returned"

    Any clues?

  5. #5
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Moving a row to another sheet and deleting the empty row

    Lets try in this way..

    This macro has to be entered in the sheet where you enter the "Returned" function.

    Just to confirm you have the value" Returned" enter the column 1 is it?

  6. #6
    Registered User
    Join Date
    01-18-2013
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Moving a row to another sheet and deleting the empty row

    Thats correct.

    I shut the sheet done and reopened it and now it works! without the error.

    Thanks Raga!

  7. #7
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Moving a row to another sheet and deleting the empty row

    That's Great!!!


    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

+ 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