Spaces to be removed from string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • userhelp1
    New Member
    • Jan 2016
    • 1

    Spaces to be removed from string

    Hi,

    I am building a dashboard with Excel but using .Net to automate some of the data which needs copying and pasting into the workbook. i have a column within Excel that have spaces within the string that i need removing. For example all numbers in Column B need removing leaving just the value.

    How do i tell .net to do this

    I tried using the below WB1Ws = Dim WB1WS As Excel.Worksheet

    WB1WS.Range("g2 ").Formula = "=SUBSTITUTE(b2 ," ","")"

    however it doesnt seem to like the formula
  • Luk3r
    Contributor
    • Jan 2014
    • 300

    #2
    You should use VB.net to read your cell data, modify the string, and then re-write the cell data instead of trying to write a formula.

    Comment

    Working...