excel macro

  • Thread starter Thread starter Jem
  • Start date Start date
J

Jem

hi to all,

I have this data 1234 in cell K27.
how to make macro that will add "0 to the beginning:

My data is:

1234

That the result will look like this:

"01234



Thanks,
Lorena
(e-mail address removed)
 
hi to all,

I have this data 1234 in cell K27.
how to make macro that will add "0 to the beginning:

My data is:

1234

That the result will look like this:

"01234



Thanks,
Lorena
(e-mail address removed)


try this macro:

Sub jem()
With ActiveSheet
.Cells(27, 11) = """0" & .Cells(27, 11)
End With
End Sub

Hope this helps / Lars-Åke
 
then you could use the custom number format \"00000

But the cell would still just contain 1234 - don't know what the OP wants
actually stored in the cell

for a macro:

Sub FormatCell
ActiveCell.NumberFormat = "\""00000"
End sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top