select various cells in one column and move to the next column

Mldeuser

Well-known Member
Joined
Dec 27, 2008
Messages
574
Office Version
  1. 365
Platform
  1. Windows
Hello

I have a problem. I would like to select various cells in one column and then move them to the next column in the same row.

The size of the spreadsheet will change with each use.

Example: the words Balance Forward Appear in cells I11, I23, I34, I36, I42. and so on. They need to be in column J (same cell numbers).

I googled this and could not find a solution that worked.

Any help would be greatly appreciated.

Thank you
Mark
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Code:
Sub MoveItRight()
Dim cell As Range
For Each cell In [I1:I100]
    if cell.Value = "Balance Forward" then
       cell.offset(0,1).value=cell.value
       cell.value=""  
     end if
Next cell
End Sub
not tested, just typing.....
 
Last edited:
Upvote 0
How about
Code:
Sub Mldeuser()
   With Range("I2", Range("I" & Rows.Count))
      .Replace "Balance Forward", True, xlWhole, , False, , False, False
      .SpecialCells(xlConstants, xlLogical).Offset(, 1).Value = "Balance Forward"
      .SpecialCells(xlConstants, xlLogical).ClearContents
   End With
End Sub
 
Upvote 0
It works, can it be updated to look at the entire column "I" and move any it finds. The range can be anywhere from 50 lie items to 5000 line items.

Thank you
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
One other thing once the words Balance Forward is moved to column J is it possible to use this to look at column L and if the cell has a value move that value to column M.
 
Upvote 0
Will there be anything else on those rows from col J onwards that needs to remain where it is?
 
Upvote 0
Column L does have values in other rows that need to stay in column L. Only the values in column L where column J has "Balance Forward in the same row need to be moved to column M
 
Upvote 0
Yes, but are there values on those rows that need to remain where they are, so for instance if "Balance Forward" is in I15 do you have anything in (say) K15,N15 that need to stay in those cells?
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top