Extract Data Contains Mark etc...As Number

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all..

how to extract data below (contains mark etc.)
Book1
KL
3data (text)target (number)
4 = 1.812,00 m3 x 610.383,00 /m3 x 0,840 1,812.00
5 = 579,00 m3 x 610.383,00 /m3 x 0,840 579.00
6 = 20,00 m3 x 610.383,00 /m3 x 0,840 20.00
7 = 24.500,00 m3 x 610.383,00 /m3 x 0,840 24,500.00
8 = 356.500,00 m3 x 610.383,00 /m3 x 0,840 356,500.00
9 = 1.750.500,00 m3 x 610.383,00 /m3 x 0,840 1,750,500.00
Sheet1

my target in cell L4 down and as number not text

any help would greatly appreciated..

.sst
 
Well
Have you noticed that the above code is for testing
The it process the data in column A starting A1down
If you can not amend it to column K (K4 down) let me know will do it for you
Deal?
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Tell you what
For your data in #! Data in K ,Result in L
Try this version
VBA Code:
Sub test()
    Dim lr, i, m
    lr = Sheets("sheet1").Cells(Sheets("sheet1").Rows.Count, 11).End(xlUp).Row
    With CreateObject("VBScript.RegExp")
        .Global = True
        For i = 1 To lr - 3
            .Pattern = "(\d.+?\d+? {1,10})"
            Set m = .Execute(Cells(i + 3, 11))
            Cells(i + 3, 11).Offset(, 1) = m(0)
            .Pattern = "\."
            Cells(i + 3, 11).Offset(, 1) = .Replace(m(0), "")
            .Pattern = "\,"
            Cells(i + 3, 1).Offset(, 1) = Format(.Replace(Cells(i, 1).Offset(, 1), "."), "#,##00.00")
        Next
    End With
End Sub
 
Upvote 0
Ok!
Forget #12
this is the trimmed version
Hope you like it
Again data in K4& down

VBA Code:
Sub test2()
    Dim i As Double
    Dim m, Rx As Object
    Set Rx = CreateObject("VBScript.RegExp")
    Rx.Global = True
    For i = 1 To Sheets("sheet1").Cells(Sheets("sheet1").Rows.Count, 11).End(xlUp).Row - 3
        Rx.Pattern = "(\d.+?\d+? {1,10})"
        Set m = Rx.Execute(Cells(i + 3, 11))
        With Cells(i + 3, 11).Offset(, 1)
            .Value = m(0)
            Rx.Pattern = "\."
            .Value = Rx.Replace(.Value, "")
            Rx.Pattern = "(\,)"
            .Value = Rx.Replace(.Value, ".")
        End With
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,886
Messages
6,127,575
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top