Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8786449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:37:49+00:00 2026-06-13T21:37:49+00:00

I’m relatively inexperienced in VBA code, but have a workbook that I am trying

  • 0

I’m relatively inexperienced in VBA code, but have a workbook that I am trying to organize based on “Status” of items listed in rows.

I have a drop down box in column “M” that allows the user to select “HOLD” or “RELEASED”… Based on this value, the line item needs to be copied and pasted into the same exact row in sheet 2 if the value = “RELEASED” (Example of line item range is (“B7:N7”)(Sheets are formatted exactly the same). I have code for this, but I need to remove the line item that is “RELEASED” from sheet 1 after it is copied and pasted into sheet 2.

Here is what I have… (Parts Staging Log = Sheet 1 … Released Parts Log = Sheet 2)

Public Sub CopyPasteRows()

Sheets("Parts Staging Log").Select
' Find the last row of data
FinalRow = Range("B828").End(xlUp).Row
' Loop through each row
For x = 7 To FinalRow
' Decide to copy based on column M value "RELEASED"
ThisValue = Range("M" & x).Value
If ThisValue = "RELEASED" Then
Range("B" & x & ":BM" & x).Copy
Sheets("Released Parts Log").Select
NextRow = Range("B828").End(xlUp).Row + 1
Range("B" & NextRow).Select
ActiveSheet.Paste
Sheets("Parts Staging Log").Select
End If
Next x

End Sub

If anyone can assist me with a deletion of the original line item that would be wonderful. Other comments are accepted as well!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:37:51+00:00Added an answer on June 13, 2026 at 9:37 pm

    My take on this: remove the loop (too slow) and replace with autofilter

    Public Sub CopyPasteRows()
    Dim FinalRow As Long
    
    With Sheets("Parts Staging Log")
    ' Find the last row of data
        FinalRow = .Range("B828").End(xlUp).Row
        .Range("B6:BM" & FinalRow).AutoFilter
        .Range("B6:BM" & FinalRow).AutoFilter field:=12, Criteria1:="RELEASED"
        .Range("B7:BM" & FinalRow).SpecialCells(xlCellTypeVisible).Copy Sheets("Released Parts Log").Range("B828").End(xlUp).Offset(1)
        .Range("B7:BM" & FinalRow).SpecialCells(xlCellTypeVisible).EntireRow.Delete
        .Range("B6:BM" & FinalRow).AutoFilter    
    End With
    
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.