What programming to use in VBA to convert in to number?

  • Thread starter Thread starter Marco
  • Start date Start date
M

Marco

Hi. I'm creating a macro and in the many things that it should do I need that
selects me a few cells and then convert the content into Number.

I can do it manually, but it seems that when I'm creating a macro it don'd
record that step.

What can I do????? Any special programming?

Regards,
Marco
 
Hi,

You really haven't given a lot to go on but how about this for a start:

Sub stance()
Range("A1:A20").Select
For Each c In Selection
On Error Resume Next
c.Value = c.Value + 0
c.NumberFormat = "General"
Next
End Sub

Mike
 
Well I'm surprised and pleased in equal measure. Thanks for the feedback.

Mike
 

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

Back
Top