ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move Total from Column B to A (https://www.excelbanter.com/excel-programming/379630-move-total-column-b.html)

dd

Move Total from Column B to A
 
Hi,
Below is a macro to move any cells that contain the word Total in
Column A to Column B.
But how would I move the word total from column B to column A? Thanks

Sub testing()
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
If cell.Value Like "*Total*" Then
cell.Offset(0, 1).Value = cell.Value
cell.Value = ""
End If
Next cell
End Sub


Trevor Shuttleworth

Move Total from Column B to A
 
Sub testing()
For Each cell In Columns("B").SpecialCells(xlCellTypeConstants)
If cell.Value Like "*Total*" Then
cell.Offset(0, -1).Value = cell.Value
cell.Value = ""
End If
Next cell
End Sub

Regards

Trevor


"dd" wrote in message
oups.com...
Hi,
Below is a macro to move any cells that contain the word Total in
Column A to Column B.
But how would I move the word total from column B to column A? Thanks

Sub testing()
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
If cell.Value Like "*Total*" Then
cell.Offset(0, 1).Value = cell.Value
cell.Value = ""
End If
Next cell
End Sub




dd

Move Total from Column B to A
 
Thanks for the fast response.


On Dec 18, 11:31 am, "Trevor Shuttleworth"
wrote:
Sub testing()
For Each cell In Columns("B").SpecialCells(xlCellTypeConstants)
If cell.Value Like "*Total*" Then
cell.Offset(0, -1).Value = cell.Value
cell.Value = ""
End If
Next cell
End Sub

Regards

Trevor

"dd" wrote in ooglegroups.com...



Hi,
Below is a macro to move any cells that contain the word Total in
Column A to Column B.
But how would I move the word total from column B to column A? Thanks


Sub testing()
For Each cell In Columns("A").SpecialCells(xlCellTypeConstants)
If cell.Value Like "*Total*" Then
cell.Offset(0, 1).Value = cell.Value
cell.Value = ""
End If
Next cell
End Sub- Hide quoted text -- Show quoted text -




All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com