VBA : Make Code Run as Add In

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all..
the macro working well, i want to make "him" as add in,
note : name of sheet is random, how to modify or adapt this code below ;
VBA Code:
Sub remove_ku()
    Dim rng As Range, i As Long, ii As Long, sm As Object
    Set rng = Sheets("Sheet2").UsedRange
    With CreateObject("VBScript.RegExp")
        .Pattern = "(\d+(\.\d{3})*)(,\d{2})? m3"
        For i = 2 To rng.Rows.Count
            For ii = 10 To rng.Columns.Count Step 11
                If .test(rng.Cells(i, ii).Value) Then
                    Set sm = .Execute(rng.Cells(i, ii).Value)(0).submatches
                    rng.Cells(i, ii).Value = Replace(sm(0), ".", ",") & Replace(sm(2), ",", ".")
                End If
            Next
        Next
    End With
End Sub
across posting from Make Add In From A Code

anyone helping thank so much.

.sst
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
hi...
may it make clear, the macro code ONLY work properly in file as save .xlsm
if in a standard module and the file not i'm save as .xlsm, the macro code not working
i attachment 2 files in the secure link :
1. file as .xlsm
2. file as xlsx.

why this problem? i want the code working well as Add in with any name sheet
file as save .xlsm
file as save .xlsx
 
Upvote 0

Forum statistics

Threads
1,215,222
Messages
6,123,716
Members
449,116
Latest member
Aaagu

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