+ Reply to Thread
Results 1 to 3 of 3

Problem in WITH/END WITH code snippet

Hybrid View

  1. #1

    Problem in WITH/END WITH code snippet

    Gang -

    In set range r this code works:

    With r
    .formula = .value
    End With

    This doesn't:

    With r
    .formula = vba.replace(.value,chr(160),chr(32),1)
    End With

    What am I missing?

    Thanks in advance.
    ....best, Hash

  2. #2
    Toppers
    Guest

    RE: Problem in WITH/END WITH code snippet

    Is this what you want?

    For Each cell In r
    cell.Value = Replace(cell.Value, chr(160), chr(32), 1)
    Next

    "[email protected]" wrote:

    > Gang -
    >
    > In set range r this code works:
    >
    > With r
    > .formula = .value
    > End With
    >
    > This doesn't:
    >
    > With r
    > .formula = vba.replace(.value,chr(160),chr(32),1)
    > End With
    >
    > What am I missing?
    >
    > Thanks in advance.
    > ....best, Hash
    >


  3. #3
    Toppers
    Guest

    RE: Problem in WITH/END WITH code snippet

    rowno = Selection.Find("123").Row

    "[email protected]" wrote:

    > Gang -
    >
    > In set range r this code works:
    >
    > With r
    > .formula = .value
    > End With
    >
    > This doesn't:
    >
    > With r
    > .formula = vba.replace(.value,chr(160),chr(32),1)
    > End With
    >
    > What am I missing?
    >
    > Thanks in advance.
    > ....best, Hash
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1