Hi I am trying to make a search page on an on-line excel (www.editgrid.com) using macro to lock all cells except for (B2 cell) and each time the page is opened it clears / resets (B2 cell) and I keep getting this error Missing ; before statement at line 1 Private Sub Worksheet_SelectionChange(ByVal Target As Range) how do I fix this error. Thank you
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Selection, Range("A1:AS57")) Is Nothing Then
Range("B2").Select
End If
End Sub
Option Explicit
Private Sub Worksheet_Activate()
[search_string] = "Type your search here."
[search_string].Select
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Const CRITERIA_HEADER = "Description"
Const TEMPORARY_NAME_CREATED_BY_ADVANCED_FILTER = "Extract"
' If change was from any cell other than our lookup, then exit
If Intersect(Target, [search_string]) Is Nothing Then Exit Sub
[search_string].Select
End Sub
Option Explicitright at the top - Siddharth Rout