What I want is: only two cells are clickable, all other cells are NOT clickable.
Sub TestUnlockedCells()
Dim sFile As String
Dim wb As Workbook
MsgBox "Ready to browse your first file."
sFile = Application.GetOpenFilename("*.xl*,*.xl*")
If sFile <> "False" Then
Set wb = Workbooks.Open(sFile)
ThisWorkbook.Sheets("TestSht").Cells(8, 1).Value = wb.Name
ThisWorkbook.Sheets("TestSht").Hyperlinks.Add Anchor:=ThisWorkbook.Sheets("TestSht").Cells(9, 1), _
Address:=wb.FullName, TextToDisplay:=wb.FullName
End If
Application.DisplayAlerts = False
wb.Close savechanges:=False
Application.DisplayAlerts = True
MsgBox "Ready to browse your second File."
sFile = Application.GetOpenFilename("*.xl*,*.xl*")
If sFile <> "False" Then
Set wb = Workbooks.Open(sFile)
ThisWorkbook.Sheets("TestSht").Cells(13, 1).Value = wb.Name
ThisWorkbook.Sheets("TestSht").Hyperlinks.Add Anchor:=ThisWorkbook.Sheets("TestSht").Cells(14, 1), _
Address:=wb.FullName, TextToDisplay:=wb.FullName
End If
Application.DisplayAlerts = False
wb.Close savechanges:=False
Application.DisplayAlerts = True
End Sub
Bookmarks