jerry8989
Read the Forum Rules & use Code tags in future.
I'm not sure why you are making the variables as Public and I would use Long insttead of Integer, in case the variables exceed the Integer's capacity.
Dim rLastCol As Long
Dim rLastRow As Long
rLastCol = Me.Parent.Worksheets("VData").UsedRange.Columns.Count + 1
rLastRow = Me.Parent.Worksheets("VData").UsedRange.Rows.Count
Worksheets("Sheet1").Range(Cells(1, rLastCol), Cells(rLastCol), Cells(rLastRow, _
rLastCol)).FormulaR1C1 = "=IF(ISERROR(SEARCH(R1C,RC[-17],1)) = FALSE, ""X"","""
Bookmarks