when i run Replace(SerStr,RepStr,RepTo) it gives an error
"Cannot use parentheses when calling a Sub"
here's the code:
elseif InStr(SerStr, Ser)<>0 Then
if mid(SerStr,instr(SerStr,Ser)+len(Ser)+1,1) = 0 and Err <> 0 Then
countErr = CountErr+1
RepStr = mid(SerStr,instr(1,SerStr,Ser,1),len(Ser)+2)
RepTo = Ser & "-" & Err
Replace(SerStr,RepStr,RepTo)
end if
SerStr - contains a string serial numbers and if it has an error (ex. 123455-0)
RepStr - pulls the string i want to replace out of SerStr
RepTo - the new string I want to add
Does anyone know why this would happen
Replace Function
Started by barnigan, Nov 19 2008 12:52 PM
4 replies to this topic
#1
Posted 19 November 2008 - 12:52 PM
|
|
|
#2
Posted 19 November 2008 - 01:10 PM
Try
Replace SerStr,RepStr,RepTo
instead of
Replace(SerStr,RepStr,RepTo)
.
Replace SerStr,RepStr,RepTo
instead of
Replace(SerStr,RepStr,RepTo)
.
#3
Posted 20 November 2008 - 06:38 AM
well, that got rid of the error but now the replace function isn't doing anything
#4
Posted 20 November 2008 - 06:40 AM
Found a way around it by making my own replace
SplF = mid(SerStr,1,InStr(SerStr,RepStr)-1)
SplS = RepTo & mid(SerStr,(len(SplF)+1)+len(RepStr))
SerStr = SplF + SplS
SplF = mid(SerStr,1,InStr(SerStr,RepStr)-1)
SplS = RepTo & mid(SerStr,(len(SplF)+1)+len(RepStr))
SerStr = SplF + SplS


Sign In
Create Account


Back to top









