![]() |
UNABLE TO PUT IN A LOOP
Hi GUYS ,
I am unable to put a loop for the following code. I like to cut values from row 12 and paste them left of the values in row 9. I want to do it until there is no value left in row 12. The following code does it for one value only. Can we put some loop in it unless no value left in row 12. Dim LASTCOL As Integer LASTCOL = Sheet1.Cells(12, Columns.Count).End(xlToLeft).Column Sheet1.Cells(12, LASTCOL).Cut Sheet1.Range("A9").Select Selection.End(xlToRight).Select Selection.Offset(0, -1).Select ActiveSheet.Paste thanks ali |
UNABLE TO PUT IN A LOOP
Sub test()
Dim LASTCOL As Integer With Sheets("sheet1") .Activate LASTCOL = .Cells(12, Columns.Count). _ End(xlToLeft).Column Set cutrange = Range(.Cells(12, "A"), _ .Cells(12, LASTCOL)) cutrange.Cut .Cells(9, Columns.Count).End(xlToLeft).Select Selection.Offset(0, 1).Select ActiveSheet.Paste End With End Sub "ali" wrote: Hi GUYS , I am unable to put a loop for the following code. I like to cut values from row 12 and paste them left of the values in row 9. I want to do it until there is no value left in row 12. The following code does it for one value only. Can we put some loop in it unless no value left in row 12. Dim LASTCOL As Integer LASTCOL = Sheet1.Cells(12, Columns.Count).End(xlToLeft).Column Sheet1.Cells(12, LASTCOL).Cut Sheet1.Range("A9").Select Selection.End(xlToRight).Select Selection.Offset(0, -1).Select ActiveSheet.Paste thanks ali |
All times are GMT +1. The time now is 03:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com