+ Reply to Thread
Results 1 to 5 of 5

Moving a row if a specific cell contains a number

  1. #1
    Registered User
    Join Date
    05-30-2011
    Location
    Melbourne, Aus
    MS-Off Ver
    Excel 2003
    Posts
    2

    Moving a row if a specific cell contains a number

    Hi All,

    First time poster so apologies if I'm not in the right area. My question is:

    I have set up a workbook where I can import data into Sheet2 and I have created a macro to sort and tidy the data up to a certain degree. (took me ages to get that far). Now I want to extract an entire row from Sheet2 and place it in Sheet3 based on the condition that a number appears in Column A. Can this be done with a 'If cell.Value =' statement if the value I need is a number and not text?

    So basically, I want every row which has a number in Column A moved to Sheet3. Any suggestions would be greatly appreciated.

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    03-14-2009
    Location
    Pakistan
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Moving a row if a specific cell contains a number

    You could also use 'lookup' or 'match'/'index' formulas too.
    Of course if condition can be used in macros but I am not sure about the exact syntax at the moment. Use excel help.

  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Moving a row if a specific cell contains a number

    you can use this function
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-30-2011
    Location
    Melbourne, Aus
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Moving a row if a specific cell contains a number

    Okay, I'm fumbling my way through this...

    I have tried the following code to check if Column A contains a number, and if so, move the data from the first three columns to the next worksheet:

    Please Login or Register  to view this content.

    It seems to work perfectly on some rows, but not others. Does it have something to do with not returning to the next cell correctly? (the data in the Sheet often extends beyond column C, however it's only the first three columns I need to extract, so I don't need to delete cells or to shift up)

    I've cobbled this code together from a few threads, and obviously have buggered it up...

    Thanks in advance.
    "Seen one shopping centre, seen a mall." - Anon.

  5. #5
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Moving a row if a specific cell contains a number

    i don't see anything wrong with your code, could you post your workbook to take a look at?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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