[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Move Total from Column B to A

dd

12/18/2006 7:24:00 PM

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

2 Answers

Trevor Shuttleworth

12/18/2006 7:31:00 PM

0

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" <dd2quest@gmail.com> wrote in message
news:1166469821.614265.113530@j72g2000cwa.googlegroups.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

12/18/2006 7:44:00 PM

0

Thanks for the fast response.


On Dec 18, 11:31 am, "Trevor Shuttleworth" <Tre...@Shucks.demon.co.uk>
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" <dd2qu...@gmail.com> wrote in messagenews:1166469821.614265.113530@j72g2000cwa.googlegroups.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 -