Hi , I am half through to create user form .
Just in when I click on EXECUTE button to run the code I get "compile error" - Invalid or Unqualified reference"
Can anyone help me here please, thank you
Just in when I click on EXECUTE button to run the code I get "compile error" - Invalid or Unqualified reference"
Can anyone help me here please, thank you
Code:
Private Sub CommandButton2_Enter()
Do
If xFound Is Nothing Then
Exit Do
Else
xCount = xCount + 1
xRow = xRow + 1
.Cells(xRow, 1) = xWb.Name
.Cells(xRow, 2) = xWk.Name
.Cells(xRow, 3).Formula = "=HYPERLINK(""" & xWb.FullName & """)"
.Cells(xRow, 4).Range("A1:BA1").Value = xFound.EntireRow.Range("A1:BA1").Value
End If
Set xFound = xWk.Cells.FindNext(After:=xFound)
Loop While xStrAddress <> xFound.Address
Next
xWb.Close (False)
xStrFile = Dir
Loop
.Columns("A:D").EntireColumn.AutoFit
End With
MsgBox xCount & "cells have been found", , "Result"
ExitHandler:
Set xOut = Nothing
Set xWk = Nothing
Set xWb = Nothing
Set xFld = Nothing
Set xFso = Nothing
Application.ScreenUpdating = xUpdate
Exit Sub
ErrHandler:
MsgBox err.Description, vbExclamation
Resume ExitHandler
End Sub