PDA

View Full Version : Solved: Add to end of cell



Hoopsah
07-22-2009, 12:47 AM
Hi

I am using a simple little macro to format a column and to add data to the start of each cell -

Sub Format_Column_C()
'
' Macro recorded 22/07/2009 by Gerry '
'
' SELECT THE COLUMN
Columns("C:C").Select
' SELECT THE FORMAT
Selection.NumberFormat = "[mm]:ss"

' ADD "00.0" TO THE BEGINNING OF EVERY CELL
For i = 1 To Cells(Rows.Count, "C").End(xlUp).Row

Cells(i, "C").Value = "00:0" & Cells(i, "C").Text
Next i


End Sub

How can i change this macro to do the same thing, but, add the zeros to the end of each cell

Cheers

Hoopsah

Bob Phillips
07-22-2009, 01:36 AM
Do you mean like this



Sub Format_Column_C()
'
' Macro recorded 22/07/2009 by Gerry '
'
' ADD "0000" TO THE END OF EVERY CELL
For i = 1 To Cells(Rows.Count, "C").End(xlUp).Row

Cells(i, "C").Value = Cells(i, "C").Text & "0000"
Next i
End Sub

Hoopsah
07-22-2009, 02:03 AM
That's it exactly Bob,

I had almost got there but was still receibing compile errors and couldn't work out what I was doing wrong.

Thanks for your help again Bob

Cheers

Gerry