Extract Data Contains Mark etc...As Number

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
1,766
Office Version
  1. 2016
  2. 2010
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
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
1,766
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
i want to extract or pull data from col.K, number can be extracted is number at first from left before mark "m3" first
 

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
1,766
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows

ADVERTISEMENT

VBA Code:
L4==MID(K4;3;FIND("m3";K4)-3)
Or
=MID(K4,3,FIND("m3",K4)-3)
hi mohadin, thank you..
where you're from?
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
885
Office Version
  1. 2013
Platform
  1. Windows
VBA Code:
Sub test()
    Dim lr, i, m
    Dim a As Variant
    lr = Sheets("sheet1").Cells(Sheets("sheet1").Rows.Count, 11).End(xlUp).Row
    a = Cells(4, 11).Resize(lr - 3)
    With CreateObject("VBScript.RegExp")
        .Global = True
        .Pattern = "(\d+\.\d+\,..)"
        For i = 1 To UBound(a)
            Set m = .Execute(a(i, 1))
            Cells(i + 3, 11).Offset(, 1) = m(0) * 1
        Next
    End With
End Sub
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
885
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

This may be better
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
        .Pattern = "(\d+\.\d+\,..)"
        For i = 1 To lr - 3
            Set m = .Execute(Cells(i + 3, 11))
            Cells(i + 3, 11).Offset(, 1) = m(0) * 1
        Next
    End With
End Sub
 

Tom.Jones

Active Member
Joined
Sep 20, 2011
Messages
330
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
@mohadin,

Your VBA code posted in post 6 an 7 gave incorect results.
1.812,00​
610.383,00
610.383,00
24.500,00​
356.500,00​
750.500,00
 

mohadin

Well-known Member
Joined
Mar 22, 2015
Messages
885
Office Version
  1. 2013
Platform
  1. Windows
@Tom.Jones
OOps
u'r right
So...
What about
VBA Code:
Sub test()
    Dim lr, i, m
    lr = Sheets("sheet1").Cells(Sheets("sheet1").Rows.Count, 1).End(xlUp).Row
    With CreateObject("VBScript.RegExp")
        .Global = True
        For i = 1 To lr
            .Pattern = "(\d.+?\d+? {1,10})"
            Set m = .Execute(Cells(i, 1))
            Cells(i, 1).Offset(, 1) = m(0)
            .Pattern = "\."
            Cells(i, 1).Offset(, 1) = .Replace(m(0), "")
            .Pattern = "\,"
            Cells(i, 1).Offset(, 1) = Format(.Replace(Cells(i, 1).Offset(, 1), "."), "#,##00.00")
        Next
    End With
End Sub
 

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
1,766
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
@Tom.Jones
OOps
u'r right
So...
What about
VBA Code:
Sub test()
    Dim lr, i, m
    lr = Sheets("sheet1").Cells(Sheets("sheet1").Rows.Count, 1).End(xlUp).Row
    With CreateObject("VBScript.RegExp")
        .Global = True
        For i = 1 To lr
            .Pattern = "(\d.+?\d+? {1,10})"
            Set m = .Execute(Cells(i, 1))
            Cells(i, 1).Offset(, 1) = m(0)
            .Pattern = "\."
            Cells(i, 1).Offset(, 1) = .Replace(m(0), "")
            .Pattern = "\,"
            Cells(i, 1).Offset(, 1) = Format(.Replace(Cells(i, 1).Offset(, 1), "."), "#,##00.00")
        Next
    End With
End Sub

hi...i have checked actually not true show "invalid procedure"
 

Watch MrExcel Video

Forum statistics

Threads
1,122,413
Messages
5,595,998
Members
414,037
Latest member
Roamingsmile

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
Top