Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert a number formatted as text to a number in a macro
Anyone have a simple macro that converts a number in a cell that was formatted as text or proceeded by an apostrophe? Or a work around Coverting " 12345 - xyz" Selection.Copy ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Paste ActiveCell.Offset(0, -1).Range("A1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=MID(RC[1],3,7)" ActiveCell.Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues to "12345" such that a vlookup can then match this to "12345" that's formatted as a number already. Thanks for any and all help! -- MACRE0 ------------------------------------------------------------------------ MACRE0's Profile: http://www.excelforum.com/member.php...o&userid=10848 View this thread: http://www.excelforum.com/showthread...hreadid=478087 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert a number formatted as text to a number in a macro
If '12345
is in the active Cell Sub aaa() ActiveCell.NumberFormat = "General" ActiveCell.Value = ActiveCell.Value End Sub -- Regards, Tom Ogilvy "MACRE0" wrote in message ... Anyone have a simple macro that converts a number in a cell that was formatted as text or proceeded by an apostrophe? Or a work around Coverting " 12345 - xyz" Selection.Copy ActiveCell.Offset(0, 1).Range("A1").Select ActiveSheet.Paste ActiveCell.Offset(0, -1).Range("A1").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=MID(RC[1],3,7)" ActiveCell.Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues to "12345" such that a vlookup can then match this to "12345" that's formatted as a number already. Thanks for any and all help! -- MACRE0 ------------------------------------------------------------------------ MACRE0's Profile: http://www.excelforum.com/member.php...o&userid=10848 View this thread: http://www.excelforum.com/showthread...hreadid=478087 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert a number formatted as text to a number in a macro
I appreciate it, thanks. -- MACRE0 ------------------------------------------------------------------------ MACRE0's Profile: http://www.excelforum.com/member.php...o&userid=10848 View this thread: http://www.excelforum.com/showthread...hreadid=478087 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Convert text number to number formate | Excel Discussion (Misc queries) | |||
Use formatted text instead of number value... | New Users to Excel | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) | |||
not able to convert text, or graphic number to regular number in e | Excel Worksheet Functions | |||
Convert number in text format to number | Excel Programming |