Results 1 to 3 of 3

Move every other cell in a column to row above it, then delete the previous row-help

Threaded View

  1. #1
    Registered User
    Join Date
    07-05-2006
    Posts
    7

    Move every other cell in a column to row above it, then delete the previous row-help

    I have a spreadsheet that I need to rearrange to improve readability.
    I have an example attache, which is easier to understand than describing it, but I'll try:

    I want to start in a1, move to a2
    copy a2 to b1
    delete line 2 (the previous lrow 3 now becomes row 2
    if a2 > 0.01, skip it and
    move & select cell a3
    ... and repeat the above logic, on the next series of cells...
    eg
    copy a3 to b2
    delete line 3 (the previous lrow 4 now becomes row 3
    if a3 > 0.01, skip it and
    move & select cell a4
    ...and repeat the sequence again.

    The code that I wrote partially works - When I add in the commented out lines, it does not do what I described above.
    Could someone show me the error of my ways?
    Sub Macro13()
    '
    '
            Sheets("Sheet1").Select
            Range("A2").Select
    
            Do Until Selection.Offset(-1, 0).Value = ""
                Selection.Cut
                ActiveCell.Offset(-1, 1).Select
                ActiveSheet.Paste
                ActiveCell.Offset(1, -1).Rows("1:1").EntireRow.Select
                Selection.Delete Shift:=xlUp
                ActiveCell.Offset(1, 0).Range("A1").Select
                'If (ActiveCell.Offset(1, 0).Range("A1").Select > 0.1) Then
                '    ActiveCell.Offset(0, 0).Range("A1").Select
                'End If
            Loop
            Range("A1").Select
    End Sub
    The code with the lines commented out, works to select, and move the cells in each row..when I uncomment the code that checks and skips a row, it does not behave the way I intended.

    Any help is appreciated.

    Best regards,
    J
    Attached Files Attached Files
    Last edited by jjh; 07-11-2014 at 01:53 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 04-29-2014, 08:28 PM
  2. [SOLVED] Fast way to move down a column until active cell is smaller than the previous cell value
    By herbie226 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-09-2014, 05:44 AM
  3. Auto-move previous content from cell a to cell b by changing cell a
    By Matt81a in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2013, 03:32 PM
  4. move back to previous cell if..
    By lucky_2say in forum Excel General
    Replies: 3
    Last Post: 04-28-2011, 09:40 PM
  5. Sort Column, Delete Rows, Delete Column, Move Molumn, more inside?
    By motown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2008, 09:44 AM

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