+ Reply to Thread
Results 1 to 5 of 5

Better way to copy data between columns?

  1. #1
    Registered User
    Join Date
    12-08-2008
    Location
    Sacramento, CA US
    MS-Off Ver
    2007
    Posts
    17

    Better way to copy data between columns?

    Hi all, I have a file to process that contains three columns (all integers). The first column is the sum of the other two rows. Sometimes the formatting is wrong as you can see below.
    Please Login or Register  to view this content.
    Right now I loop through each cell in column B. If it's empty, I execute the code below. It works well, but I'm wondering if there's a better/more efficient way to do this? Maybe a way that doesn't require a loop? The file can have 500+ lines, but only a few have the empty cell problem.

    Please Login or Register  to view this content.
    TIA,

    Angel
    Last edited by verdugan; 01-21-2009 at 06:24 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Try this, assuming column C is the one with blanks, adjust if not.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-08-2008
    Location
    Sacramento, CA US
    MS-Off Ver
    2007
    Posts
    17
    Quote Originally Posted by StephenR View Post
    Try this, assuming column C is the one with blanks, adjust if not.
    Please Login or Register  to view this content.
    I forgot to mention that I have some columns to the right of this one. The code above shifts those columns as well. Any idea how to only shift the columns involved?

    If I didn't have columns to the right, the code above would work perfectly. Sorry for the missing info.

    Thanks again.

    Angel
    Last edited by verdugan; 01-21-2009 at 07:13 PM. Reason: Fixed my name :-)

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    I'm finding it hard to come up with a solution avoiding a loop. Below almost works, perhaps someone else can identify why it doesn't do as I would like it to. If you have a solution which works just use that if I were you.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-08-2008
    Location
    Sacramento, CA US
    MS-Off Ver
    2007
    Posts
    17
    Quote Originally Posted by StephenR View Post
    I'm finding it hard to come up with a solution avoiding a loop. ... If you have a solution which works just use that if I were you.
    I'm thinking you might be right. I'll leave the thread open a bit more before closing it.

    Thanks all.

    Angel

+ 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