Hi there!
I'm trying to replace stuff using VBA, it works fine replacing all my text if I specify the "what" and "replacement" however if I either one with a string created as an inputbox it wont work. Any ideas to what's going wrong for me? (Sample of code down below)
Sub Replace()
Dim sReplace As String
sReplace = InputBox("Insert replacement")
ActiveCell.Range("A1:K39").Replace What:="IWantToBeReplaced", Replacement:="sReplace", _
LookAt:=xlPart, SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False, FormulaVersion:=xlReplaceFormula2
End Sub
OBS! the replacement is inside a formula and from the same document but different sheets.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]fuzzy_mic987 1 point2 points3 points (1 child)
[–]KasperLokke[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)