Worksheet.Select Replace:=False doesn’t work in 2013 or 2016

There is a bug in the current builds of Excel 2013 and 2016 (on Windows; Mac version actually works OK) that means that using the optional Replace:=False parameter for the Worksheet.Select method doesn’t work unless you already have more than one sheet selected.

 

The solution is to use an array of sheet names (or code names/objects/indices) instead.

One thought on “Worksheet.Select Replace:=False doesn’t work in 2013 or 2016

  1. Steve Stretch says:

    Yes, I found this and posted this compete solution on another forum to save working it out. Hope it helps anyone.

    Dim WSarrayVariable() As Variant
    Dim TheSheetName() As String

    ReDim TheSheetName(3)

    For x = 1 To UBound(TheSheetName)
    TheSheetName(x) = “Sheet” & x
    Next

    ReDim WSarrayVariable(1 To UBound(TheSheetName))

    For y = 1 To UBound(WSarrayVariable)
    WSarrayVariable(y) = TheSheetName(y)
    Next

    Sheets(WSarrayVariable()).Select

Leave a Reply

Your email address will not be published. Required fields are marked *