want to separate text and numeric value from one cell

Asked By sohrab
07-Sep-10 05:56 AM
Earn up to 0 extra points for answering this tough question.
Hi
can any one help me in separating text and numeric valsu from the same cell.eg

2154neerah
u6jhlfnchss
uydhjdgf001
lk544ssdfli

i want that numeric value should be separated from and it should be show me in the next cell.


Rgds
Sohrab

  re: want to separate text and numeric value from one cell

R VENKAT replied to sohrab
07-Sep-10 07:52 AM
the data is from A1 to A4
 try this macro 

Sub test()
Dim j As String, k As Long, m As Long, r As Range, c As Range
Set r = Range(Range("A1"), Range("a1").End(xlDown))
Columns("B:B").Cells.Clear
j = 0
For Each c In r
k = Len(c)
For m = 1 To k
If IsNumeric(Mid(c, m, 1)) Then
j = j & Mid(c, m, 1)
End If
Next m
j = Right(j, Len(j) - 1)
MsgBox j
c.Offset(0, 1).NumberFormat = "@"
c.Offset(0, 1) = j
j = 0
Next c
End Sub

  re: want to separate text and numeric value from one cell

Rolf Jaeger replied to sohrab
07-Sep-10 02:41 PM
Hi Sohrab:

here is a slightly simplified version of the code submitted by R Venkat.

Sub ExtractNumbers()
  Dim j As String, k As Long, m As Long
  Dim r As Range, c As Range
  Set r = ActiveSheet.UsedRange.Columns("A")
  Columns("B:B").Cells.Clear
  For Each c In r.Cells
    j = ""
    For m = 1 To Len(c.Value)
      If IsNumeric(Mid(c, m, 1)) Then j = j & Mid(c, m, 1)
    Next m
    c.Offset(0, 1).Value = Conversion.CInt(j)
  Next c
End Sub

Best wishes,
Rolf
Create New Account
How to change the size of the cells with a macro Hi guys, In excel 2007 there's a scale bar in the bottom right graphics. Is there a way to do this with a macro? My screen is set at 1400x 900 and when I would be great to alter this or even better get excel to do this automatically. Any ideas please? Thanks Bojo Try Range Set isect = Application.Intersect(Target, Range("D7:AK28")) If IsNumeric(Target) And Not (isect Is Nothing) Then If Target.Value Size = 10 End If End If End Sub Try this macro- Sub RowHeightInInches() Dim inches As Single ' Get the desired column inches) End If End Sub follow this also = http: / / support.microsoft.com / kb / 213422 Hi Bojo Try ActiveWindow.Zoom = 75 Hey
LEN(A1)-8) Bruce hi bruce I tried this in macro but it won't work Hello when you say 'in macro' what do you mean? . This is just and excel formula and can be entered directly into an excel cell. bruce If you are looking for a macro; select the range and run this Sub Macro() Dim cell As Range For Each cell In Selection If cut and paste and a box came up and said microsoft office excel cannot calculate a formula. cell references in the forula's paste the columns for me bruce OK. Try the below macro. Sub Macro() Dim cell As Range For Each cell In Range("A1
trying to import variable length list data from SAP into excel. The format of the data is always the same, but Since the daa is numeric you can also try the IsNumeric function on the cell contents. This macro will work with variable length rows or columns. It does able to apply it to your situation. Sub sort1() ' ' sort Macro NumRecsdown = Range("A8").End(xlDown).Row NumRecsacross = Range("K6").End 1, MatchCase: = False, Orientation: = xlTopToBottom complaining of the following error:- - -- -- -- -- -- -- -- -- -- -- -- -- -- Microsoft Visual Basic - -- -- -- -- -- -- -- -- -- -- -- -- -- Compile error: Syntax error - -- -- -- -- -- -- -- -- -- -- -- -- -- OK Help - -- -- -- -- -- -- -- -- -- -- -- -- -- I have
The most information in one page is here: http: / / msdn.microsoft.com / en-us / libr. . .ffice.11).aspx Other pages to to automate the whole thing) http: / / www.dicks-clicks.com / excel / olSending.htm Hope this will help you. try something like End Sub http: / / forums.techguy.org / business-applications / 985402-solved-excel-e-mail-notification.html refer this code, use Cell A1 and will run the macro if the cell value <0 1 ) Right click on a the sheet module. 3 ) Alt-q to go back to Excel Note : Change YourMacroName to the name of your macro in the code. If you want the code to work Not Application.Intersect(Range("A1"), Target) Is Nothing Then If IsNumeric(Target.Value) And Target.Value > 0 Then 'Call YourMacroName End If End If End Sub For sending mail from outlook macro to create / display a Outlook mail with a small text message. You must copy this macro in a standard module and not in the worksheet module Set OutApp = Nothing End Sub sorry small mistake, change If IsNumeric(Target.Value) And Target.Value > 0 Then 'Call YourMacroName End
Microsoft Excel Microsoft Excel (full name Microsoft Office Excel ) is a spreadsheet application written and distributed by Microsoft for Microsoft Windows and Mac OS X . It features calculation, graphing tools pivot tables and a macro programming language called VBA ( Visual Basic for Applications ). It has spreadsheet for these platforms, especially since version 5 in 1993. Excel forms part of Microsoft Office . The current versions are Microsoft
Microsoft Excel Microsoft Excel (full name Microsoft Office Excel ) is a spreadsheet application written and distributed by Microsoft for Microsoft Windows and Mac OS X . It features calculation, graphing tools pivot tables and a macro programming language called VBA ( Visual Basic for Applications ). It has spreadsheet for these platforms, especially since version 5 in 1993. Excel forms part of Microsoft Office . The current versions are Microsoft
calling an excel macro from aspx page I want to call an excel macro from aspx page to create the cutomized excel reports. any help. thnx in advance I want to call a excel macro from the aspx page and not pasting a dataset to the excel Use Microsoft.Office.Interop assembly to call the macro function in the underlying excel. For e.g. "mac" is
Microsoft.Office.Interop.Excel Hi, I am using Microsoft.Office.Interop.Excel to export the System.data Datatable values to the MS Excel. using Excel = Microsoft.Office.Interop.Excel; Excel.Application App = null Excel._Workbook WB = null; Excel._Worksheet WS = null; / / Start Excel and