Forum Discussion

shaifful's avatar
shaifful
Copper Contributor
Aug 23, 2021
Solved

Need help to replace certain string like "/" in the cell to underscore during save as pdf

Hi everyone,  I'm not very good at excel VBA and hoping you guys can help me to replace certain characters like "/" to "_" if the character exists in the cell that I wanted to print, like in the cod...
  • HansVogelaar's avatar
    Aug 24, 2021

    shaifful 

    Change

    strName = wsA.Range("f10").Value _
              & " - " & wsA.Range("d3").Value

    to

    strName = Replace(wsA.Range("f10").Value _
              & " - " & wsA.Range("d3").Value, "/", "_")

Resources