View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
exceluserforeman
 
Posts: n/a
Default HELP ME PLEASEEE- how to format data in a column

Say A2 is the start of the column of data


Put this routine in a Module in VB Editor (Tools Macro Vb Editor )
Toolbar insert Module

Module1 shows in the projects window

copy and paste this macro into it



Close the vBeditor then
On the sheet toolbar Run macro


Sub AddABToData()
Dim strcell, strAB as string
strAB="AB"
range("A2") .select
set a=selection
'aSSUMES THERE IS MORE THAN ONE FILLED CELL
range(a,a.end(xldown)).select
for each cell in selection
if cell.value<"" then
strCell=strAB & cell.value
cell.value=strCell
end if
next

end sub

- -mark


"Riza" wrote:

I have like 5000 different data and I need to add letter ab in front of them.
Could anyone tell me how to do this.

for example 123 is what it says but I need ab123 and each row is different
number.