Link to home
Start Free TrialLog in
Avatar of military donut
military donutFlag for United States of America

asked on

macro Excel Move Cells upward

hello,

I have an Excel spreadsheet that I need to move evrerything up 2 cells

Starting at B3 to H3 to the bottom of the spreadsheet (which could contain 2000 cells downward

Hope that makes sence.

Is there a macro I could run that could do this?
SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of military donut

ASKER

Sure...

I am attaching
Sample.xlsx
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Norie
Norie

Try this.
Sub MoveThings()

    With Sheets("Original")
        .Range("B1:H2").Delete xlShiftUp
        .Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
        With .UsedRange
            .WrapText = False
            .Columns.AutoFit
        End With
    End With
    
End Sub

Open in new window

thanks to both.  Both work...

You are awesome.
umm...so I guess this doesn't split it now?  Plus I need to know how to change the selection...anyone know?
I guess you have selected the wrong post as assisted solution. You may click on Report Question link under your question and request a moderator to reopen the question and then you can choose the correct post as an assisted answer again.
So now my solution is not even accepted as an assisted solution.:)
@Norie

I think he is having hard time in splitting the points.
I thought he raised the question as he accepted the wrong post of mine as assisted solution and which was true and that post is still accepted as an assisted solution.
Please raise the report the question again so that he can once again accept your answer as the best answer.
Subodh

It's not a problem, I think I've seen other people having problems splitting points.