Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Nou pe simpatie: beatrice17 pe Simpatie
 | Femeie 25 ani Bucuresti cauta Barbat 25 - 80 ani |
|
|
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
|
| #1 |
|
|
Source:
So I created 2 lists of months, in R1:R12 the list below which I named FIND: January February March April May June July August September October November December
In S1:S12 the list below which I named REPLACE: 01 02 03 04 05 06 07 08 09 10 11 12
In your PERSONAL.XLSB file, in a module put the following UDF (User Defined Function):
Function REPLACETEXTS(strInput As String, rngFind As Range, rngReplace As Range) As String
Dim strTemp As String Dim strFind As String Dim strReplace As String
Dim cellFind As Range
Dim lngColFind As Long Dim lngRowFind As Long Dim lngRowReplace As Long Dim lngColReplace As Long
lngColFind = rngFind.Columns.count lngRowFind = rngFind.Rows.count lngColReplace = rngFind.Columns.count lngRowReplace = rngFind.Rows.count
strTemp = strInput
If Not ((lngColFind = lngColReplace) And (lngRowFind = lngRowReplace)) Then REPLACETEXTS = CVErr(xlErrNA) Exit Function End If
For Each cellFind In rngFind
strFind = cellFind.Value strReplace = rngReplace(cellFind.Row - rngFind.Row + 1, cellFind.Column - rngFind.Column + 1).Value strTemp = Replace(strTemp, strFind, strReplace)
Next cellFind
REPLACETEXTS = strTemp
End Function |
Here's an example of the syntax: =PERSONAL.XLSB!REPLACETEXTS(L2;$R$1:$R$12;$S$1:$S$12)
If you just want the formula without "PERSONAL.XLSB!" you will need to make a module in your workbook and then save the workbook as macro enabled, or make an add-in which will load with Excel.
More on find and replace without VBA - with SUBSTITUTE, INDEX https://www.ablebits.com/office-addins- ... functions/ https://www.howtoexcel.org/vba/how-to-f ... xt-string/ https://exceljet.net/formula/find-and-r ... ple-values =SUBSTITUTE(SUBSTITUTE(B5;INDEX(find;1);INDEX(replace;1));INDEX(find;2);INDEX(replace;2))
_______________________________________

|
|
| |
|