Results 1 to 6 of 6

Proper syntax to move a row to another sheet with a variable involved.

Threaded View

  1. #1
    Registered User
    Join Date
    12-30-2008
    Location
    Riverside, CA
    MS-Off Ver
    Excel 2007
    Posts
    15

    Proper syntax to move a row to another sheet with a variable involved.

    MODS PLEASE DELETE THIS. I WILL RE-POST TO PROPER FORUM. SORRY.


    I have this piece of code that when a cell is marked as "archived" it moves the whole row to the "Archive" sheet.

    '  Move To Archive
        If Not Intersect(Target, Sheets("Sheet1").Range("F1:F300")) Is Nothing Then
            If Target.Value = "Archived" Then
              ActiveCell.EntireRow.Cut Sheets("Archive").Range("A65536").End(xlUp).Offset(1, 0)
              ActiveCell.EntireRow.Delete
    I am making revisions and I am running into a problem. I have a variable sArchive whose value lets say is "Jan"

    What I need to happen now is to move this row to the sheet of the value of sArchive

    I have tried this:

    ActiveCell.EntireRow.Cut Sheets(sArchive).Range("A65536").End(xlUp).Offset(1, 0)
    Only to get errors. I have tried various things but I cannot figure this one out. I know this has to be really simple, but I am still a noob when it comes to vba.

    Thanks for any help in advance
    Last edited by Permagrin; 12-30-2008 at 01:54 PM. Reason: wrong forum (doh)

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