Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move cell contain from Column A to B anythign with the word Total
Hello All,
I want to move any cells that contain the word Total in Column A to Columb B. I have a macro, but I have to have the exact name. Example of the code: ElseIf .Cells(lRow, "A").Value = "01 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "01 Total" ElseIf .Cells(lRow, "A").Value = "02 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "02 Total" So want to just have the word Total in the code and it will move those cells. So would appreciate any help. Thanks, J |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move cell contain from Column A to B anythign with the word Total
Try this
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 -- Regards Ron de Bruin http://www.rondebruin.nl "Juan" wrote in message ... Hello All, I want to move any cells that contain the word Total in Column A to Columb B. I have a macro, but I have to have the exact name. Example of the code: ElseIf .Cells(lRow, "A").Value = "01 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "01 Total" ElseIf .Cells(lRow, "A").Value = "02 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "02 Total" So want to just have the word Total in the code and it will move those cells. So would appreciate any help. Thanks, J |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move cell contain from Column A to B anythign with the word Total
For each cell in sheets
Do If Right(Activecell,5) = "Total" Then 'make the move End if Activecell.Offset(1,0).Activate Loop while activecell "" Next -- Best wishes, Jim "Juan" wrote: Hello All, I want to move any cells that contain the word Total in Column A to Columb B. I have a macro, but I have to have the exact name. Example of the code: ElseIf .Cells(lRow, "A").Value = "01 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "01 Total" ElseIf .Cells(lRow, "A").Value = "02 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "02 Total" So want to just have the word Total in the code and it will move those cells. So would appreciate any help. Thanks, J |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Move cell contain from Column A to B anythign with the word To
Hello Ron and Jim, Thanks alot for the help. Really appreciated. Thanks, J "Jim Jackson" wrote: For each cell in sheets Do If Right(Activecell,5) = "Total" Then 'make the move End if Activecell.Offset(1,0).Activate Loop while activecell "" Next -- Best wishes, Jim "Juan" wrote: Hello All, I want to move any cells that contain the word Total in Column A to Columb B. I have a macro, but I have to have the exact name. Example of the code: ElseIf .Cells(lRow, "A").Value = "01 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "01 Total" ElseIf .Cells(lRow, "A").Value = "02 Total" Then .Cells(lRow, "A").Value = "" .Cells(lRow, "A").Offset(0, 1).Value = "02 Total" So want to just have the word Total in the code and it will move those cells. So would appreciate any help. Thanks, J |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
if a word is in a cell I want the total in that column | Excel Discussion (Misc queries) | |||
move column total in pivot table to begining | Excel Discussion (Misc queries) | |||
Find the word "total" in a cell, delete row or column | Excel Programming | |||
Find the word "total" in a cell, delete row or column | Excel Programming | |||
Find the word "total" in a cell, delete row or column | Excel Programming |