![]() |
What programming to use in VBA to convert in to number?
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 |
What programming to use in VBA to convert in to number?
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 "Marco" wrote: 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 |
What programming to use in VBA to convert in to number?
I think it works.
YOU A STAR..... Cheers, Marco "Mike H" wrote: 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 "Marco" wrote: 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 |
What programming to use in VBA to convert in to number?
Well I'm surprised and pleased in equal measure. Thanks for the feedback.
Mike "Marco" wrote: I think it works. YOU A STAR..... Cheers, Marco "Mike H" wrote: 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 "Marco" wrote: 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 |
All times are GMT +1. The time now is 05:06 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com