C
Craig
I want to write a function called cleanse(). I want it to
work the way the sqrt() function works, as in you put it
in a cell (such as B1) and it works on whatever cell is
entered as the parameter (such as A1).
This function (if =cleanse(A1) were entered in cell B1,
for instance) would take what is in A1 (maybe a part #
like N-11-4) and take out all specified characters and put
the cleansed part number in B1 (looking like N114).
Can someone please give me some guidance on how this would
be accomplished? Below is what I have so far....it puts 0
in the cell, but does not do what I want...any help would
be appreciated...
Function Cleanse(the_cell)
For Each the_cell In Selection
ActiveCell.Replace What:="P/N", Replacement:="", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
ActiveCell.Replace What:="(FINE)", Replacement:="",
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
ActiveCell.Replace What:="(ALT)", Replacement:="",
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next the_cell
End Function
work the way the sqrt() function works, as in you put it
in a cell (such as B1) and it works on whatever cell is
entered as the parameter (such as A1).
This function (if =cleanse(A1) were entered in cell B1,
for instance) would take what is in A1 (maybe a part #
like N-11-4) and take out all specified characters and put
the cleansed part number in B1 (looking like N114).
Can someone please give me some guidance on how this would
be accomplished? Below is what I have so far....it puts 0
in the cell, but does not do what I want...any help would
be appreciated...
Function Cleanse(the_cell)
For Each the_cell In Selection
ActiveCell.Replace What:="P/N", Replacement:="", LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
ActiveCell.Replace What:="(FINE)", Replacement:="",
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
ActiveCell.Replace What:="(ALT)", Replacement:="",
LookAt:= _
xlPart, SearchOrder:=xlByRows, MatchCase:=False
Next the_cell
End Function