Remove Alpha & Multiply Macro

Russ At Index

Well-known Member
Joined
Sep 23, 2002
Messages
708
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Morning ,

I have the following data that i need to run a macro
based task with:

I extract a piece of data which has three alpha characters ,
28E15B1P ( E , B & P )

If it is possibe , i would like the operative to run a macro that
removes the E , B and the 1P , so we are left with 28 and 15 ,
then multiply the 28 by the 15.

So the numeric before the E is multilpied by the numeric after the
E but before the B

TIA

Russ
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Are the alphacharacters in question always going to be "E" and "B"?
Will the numbers you want to multiply be 2 digits long or of varying length?
 
Upvote 0
Hi JackDanIce,

The extract will always contain E , B & 1P

The numerics i would like to multiply in theory could
be varying length , from single digit up to three digits.

Thanks

Russ
 
Upvote 0
Hi Russ,

As formula, you can enter:
Code:
=(LEFT(A1,FIND("E",A1)-1)+0)*(MID(A1,FIND("E",A1)+1,FIND("B",A1)-FIND("E",A1)-1)+0)
And drag it down to the last row

As macro, try:
Code:
Sub ImNotNamingYou ()
 
Dim i As Long
With Application
    .ScreenUpdating = False
    .Calculation = xlCalculationManual
End With

Range("B1").Formula = "=(LEFT(A1,FIND(""E"",A1)-1)+0)*" _
    & "(MID(A1,FIND(""E"",A1)+1,FIND(""B"",A1)-FIND(""E"",A1)-1)+0)"
    
i = Range("A" & Rows.Count).End(xlUp).row
    
With Range("B1")
    .Formula = "=(LEFT(A1,FIND(""E"",A1)-1)+0)*" _
        & "(MID(A1,FIND(""E"",A1)+1,FIND(""B"",A1)-FIND(""E"",A1)-1)+0)"
    .AutoFill Range("B1:B" & i)
End With

With Application
    .ScreenUpdating = True
    .Calculation = xlCalculationAutomatic
End With

End Sub
 
Upvote 0
Hi JackDanIce,

Thanks Mate , runs like clock work , this will save
a heap of time !

Have a good day ,

Russ
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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