+ Reply to Thread
Results 1 to 6 of 6

How to move entire rows if a condition is met

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    Pickerington, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    3

    How to move entire rows if a condition is met

    Hi all,

    I need a vba code that can move an entire row if a condition in column G is met. I've seen some similar things on here, but they have a number condition, usually if "0" is in a cell, to be met. However, what I will need is it to recognize text and sort due to that. In column G, either "Information", "Budget", or "Quote" will be entered. If "Information" is entered, it will go to a tab called unqualified leads. If it is "Budget" or "Quote" then it will go to a tab called qualified leads. Thanks in advance for all your help.

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: How to move entire rows if a condition is met

    you say you have seen soe code that suits. To test a string it is simply a matter of putting the string in quotes

    eg
    if range("A1")=0 then

    or

    if range("A1")="hello" then


    click on the * Add Reputation if this was useful or entertaining.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How to move entire rows if a condition is met

    Try:

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to move entire rows if a condition is met

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-12-2013
    Location
    Pickerington, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: How to move entire rows if a condition is met

    Thank you so much to everyone who replied! I tried both codes and couldn't get yours to work John. Stnkynts I did get yours to work. Tony thanks for the help but i needed more in depth help as I am fairly new with VBA. Thanks again everyone!

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to move entire rows if a condition is met

    The code I posted is for a Worksheet Event and should be placed in the Sheet Module.

+ 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. Move entire row to new sheet if condition is true in a specific column
    By mic1978 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2013, 08:29 AM
  2. [SOLVED] VPA delete entire row if condition met & move upxit from macro
    By Alfie101 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-04-2012, 03:27 AM
  3. Move entire row automatically to another worksheet if condition is met
    By starr5128 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2011, 06:38 PM
  4. Move rows to new sheet on condition
    By mjsmith127 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-23-2010, 03:57 AM
  5. [SOLVED] Copy entire rows matching condition to a new sheet
    By JP in forum Excel General
    Replies: 3
    Last Post: 05-20-2005, 07:06 PM

Tags for this Thread

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