• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

Push cells down in Excel.

I am looking for a way in excel to push all the cells from D to K by one. Any ideas?
0
Blowfelt82
Asked:
Blowfelt82
  • 3
  • 2
1 Solution
 
jppintoCommented:
Select the range and click on the edge of the selected area and drag and drop to the position you want...
0
 
Blowfelt82Author Commented:
Sorry, my fault... I meant to do this in VBA script
0
 
jppintoCommented:
Something like this:

Range("D1:K1000").Select
Selection.Cut Destination:=Range("D2")
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Blowfelt82Author Commented:
Ok, I am using the line Cells(i, 1).Select, so will not necessarily know the column letter, is there a way I can do this from the selected cell row?
0
 
jppintoCommented:
If you want to move a range, you can just select a cell with Cells(x,y), you need to select a range.
0
 
Elton PascuaCommented:
Not sure by what you mean to "push down" when you want to move values across.

The procedure below moves all your cells in column D to column K. All columns from D and K will all move to the right. Not sure if this is what you wanted.

Sub MoveToK()

    Dim ws As Worksheet
    Set ws = ThisWorkbook.Worksheets("Sheet1")
    Dim lr As Long
    Dim moveRange As Range
    Dim i As Integer
    
    lr = ws.UsedRange.Rows.Count
    Set moveRange = ws.Range("D1:D" & lr)
    
    For i = 1 To 7
        moveRange.Insert Shift:=xlToRight
    Next i
    
End Sub

Open in new window

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now