+ Reply to Thread
Results 1 to 7 of 7

Copy non-Zero columns to new location macro

  1. #1
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Copy non-Zero columns to new location macro

    I need a macro to run down a column A and where its value is >0 I need to copy two columns to a new location.

    ----a----b----c----d
    1---6---a
    2---0---b
    3---4---c

    In this case I need to copy "6" to C1 and "a" to D1. Then copy "4" to C2 and "c" to D2. There are up to five hundred rows.

    Thanks for helping this thick headed sole.

    Craig
    Last edited by Craigm; 06-16-2005 at 01:28 PM.

  2. #2
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Give this a try

    Please Login or Register  to view this content.
    Select the range or column you want to operate on and then run the marco.

    HTH

  3. #3
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Post Almost does not move 0 but moves all else

    Thanks for the quick reply.

    This does not move the zeros. But it does copy column B to column C in error when a zero is present in column A.

    This is very close. If there is a zero in column A I want to skip the whole row.

    Thanks for your help.

    Craig

  4. #4
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    My Bad

    My Bad, I got the code wrong. This worked perfect! Thanks for the OUTSTANDING help!

  5. #5
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Cool Column A Must be Selected

    For the posted code to work Column A must be manually selected.

    How do I focus this code on say a range from AC3 to AC75? So that the code will run without having to select the data?

  6. #6
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    You can hard code the range to operate on either of these two ways. I'm assuming that you want the results offset by 2 columns into AE and AF. You can modify the destination ranges as needed.

    Please Login or Register  to view this content.
    Take your pick

    HTH

  7. #7
    Registered User
    Join Date
    06-16-2005
    Posts
    62

    Talking WOW! Thank you!

    Your timely help is amazing. I have struggled with this all day.

    Thank YOU!

+ Reply to Thread

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