I tried your code in Excel 2013. Possible reasons could be that ThisWorkbook is not the active workbook or that sheets are invisible. You should only use the select function on the active workbook. See below your code updated - I used it in a workbook with hidden sheets and it worked. Look at the immediate window in the VBA Editor (Ctrl+G) to see the Debug messages. Note that hidden sheets count as well for your variable 'n'. Hope it helps.
Sub test()
Dim i
Dim n
Dim foundFirstVisSheet As Boolean
foundFirstVisSheet = False
n = InputBox("type n")
Dim mySh As Worksheet
For i = 1 To n
Set mySh = ActiveWorkbook.Sheets(i)
If mySh.Visible = xlSheetVisible Then
If Not foundFirstVisSheet Then
foundFirstVisSheet = True
mySh.Activate
End If
Debug.Print mySh.Name & " is visible"
mySh.Select Replace:=False
Else
Debug.Print mySh.Name & " is invisible and cannot be selected"
End If
Next i
End Sub