Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Moving data in the last cell of row to another column cell

  Asked By: Kiral    Date: Sep 17    Category: MS Office    Views: 1173
  

I have a spreadsheet with rows of variable length where the last cell
with data in each row is not always the same column. I want to move
the last cell value in each row so that it is in the same column for
each row. (Also, every other row is blank.)

Here's what I have:


Sub MovingFinalValue()
'
' MovingFinalValue Macro
'
Dim LastValueCol As Single

LastValueCol = Cells(1, Columns.Count).End(xlToLeft).Column


lastrow = Cells(Rows.Count, 1).End(xlUp).Row

For i = lastrow To ActiveCell.Row Step -2

Range(LastValueCol).Select
Selection.Cut
Range("Y:1").Select
ActiveSheet.Paste

Next

'
End Sub

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Moving data in the last cell of row to another column cell Or get search suggestion and latest updates.




Tagged: