+ Reply to Thread
Results 1 to 7 of 7

Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

Hybrid View

  1. #1
    Registered User
    Join Date
    08-22-2013
    Location
    United states of america
    MS-Off Ver
    2013
    Posts
    4

    Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    Hello I am looking for a VBA code to Copy Rows from sheet “Equipment List” to sheet “Shipping Record” when a Validation dropdown is selected to YES in Column N.
    It would also clear the contents of that row Column C through N for new entry. Please help!
    Thank you
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-22-2013
    Location
    United states of america
    MS-Off Ver
    2013
    Posts
    4

    Re: Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    I was able to get this to work, but when it transfers to the other sheet a separate row is created containing the worksheet name "Equipment"List



    Sub Worksheet_Change(ByVal Target As Range)
    Dim strSource
    If Not Intersect(Target, Range("N:N")) Is Nothing Then
        If Target.Count > 1 Then Exit Sub
        Application.EnableEvents = False
        If Target.Value = "YES" Then
            strSource = ActiveSheet.Name
            Range("B" & Target.Row & ":Q" & Target.Row).Copy
           With Sheets("Shipping Record").Range("B" & Rows.Count).End(xlUp).Offset(1)
                .PasteSpecial xlPasteFormats
                .PasteSpecial xlPasteValues
            End With
            Sheets("Shipping Record").Range("B" & Rows.Count).End(xlUp).Offset(1) = strSource
            Application.CutCopyMode = False
            Range("C" & Target.Row & ":Q" & Target.Row).ClearContents
        End If
        Application.EnableEvents = True
    End If
    Thank you.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    Hi Bookstr

    That's happening here
    Sheets("Shipping Record").Range("B" & Rows.Count).End(xlUp).Offset(1) = strSource
    Where do you want
    the worksheet name "Equipment"List
    Assuming Column A, try this
    Sheets("Shipping Record").Range("B" & Rows.Count).End(xlUp).Offset(0,-1) = strSource
    If it doesn't work let me know...I'll look at the File.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    08-22-2013
    Location
    United states of america
    MS-Off Ver
    2013
    Posts
    4

    Re: Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    Thank you John worked like a charm. Is there a way to hide it?

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    Hi Bookstr

    Regarding this
    Is there a way to hide it?
    Yes...you could take a couple of approaches:
    • You could hide the entire Column
    • You could change the Font of that Column to White such that the Column will still be visible but the Text will be White and appear to be unseen.

  6. #6
    Registered User
    Join Date
    08-22-2013
    Location
    United states of america
    MS-Off Ver
    2013
    Posts
    4

    Re: Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    Thank you again. This is now Solved!

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown

    You're welcome...glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Counting the number of empty cells based on a condition in a range
    By naga in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-01-2013, 10:01 AM
  2. [SOLVED] Macro to cut row and paste into secondary worksheet based on dropdown value
    By sol2010 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-17-2013, 05:32 PM
  3. Replies: 0
    Last Post: 06-19-2012, 10:16 AM
  4. insering empty row based on a condition
    By darkhorse4321 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2010, 02:16 AM
  5. Copy/Paste from one sheet to another based on condition
    By TheTempest in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-16-2010, 01:13 PM

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