Results 1 to 8 of 8

Substitute code partly working

Threaded View

drewship Substitute code partly working 01-19-2010, 03:08 PM
StephenR Re: Substitute code partly... 01-19-2010, 03:20 PM
Domski Re: Substitute code partly... 01-19-2010, 03:20 PM
rwgrietveld Re: Substitute code partly... 01-19-2010, 03:53 PM
StephenR Re: Substitute code partly... 01-19-2010, 03:58 PM
drewship Re: Substitute code partly... 01-19-2010, 03:26 PM
rwgrietveld Re: Substitute code partly... 01-19-2010, 04:12 PM
StephenR Re: Substitute code partly... 01-19-2010, 04:54 PM
  1. #1
    Forum Contributor
    Join Date
    04-30-2009
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    496

    Substitute code partly working

    Hello all. I have an interesting problem. I have the following code block in my spreadsheet. The first 'With' section works every time. The second 'With' section only works if I step through the code manually using F8. If I run the the entire macro using the Process button, it seems like the second 'With' block is just skipped alltogether. I tried commenting out the first 'With' block and when the Process button is pressed, the second 'With' section still seems to be skipped. I have attached a copy of the workbook. Can someone help fix this?

    With Sheets("Class Roster Template")
        For Each rng In .UsedRange
            rng = WorksheetFunction.Substitute(rng, "/", "")
        Next rng
    End With
    
    With Sheets("Class Roster Template")
    For Each rng1 In Range("J2", Range("J2").End(xlDown))
            rng1 = WorksheetFunction.Substitute(rng1, "M", "L")
        Next rng1
    End With
    Thanks,
    Andrew
    Attached Files Attached Files

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