VBA loop to replace all characters in a string and writing the result to a single cell (Excel) -
what i'm trying take user-inserted text cell , convert morse code, write result different cell. can't figure out how write result, current code saves last character in morse code array changed in output string (if exists in input string).
m number of characters in both arrays.
for = 1 m output = replace(input, a$(i), b$(i)) next range("output") = output
if understand question correctly think problem you're overwriting output
in each iteration of loop. try changing code to:
for = 1 m output = output & replace(input, a$(i), b$(i)) next range("output") = input
note added output &
tells append new value output rather overwriting it.
Comments
Post a Comment