The final code looks like this if anyone else is facing the same issues 
Sub ImportWorkbooks()
'Declare variables
Dim objFSO As Object, objFolder As Object, objFile As Object
Dim ImportValue As Range, RngToCopy As Range, RngToPaste As Range
Dim Answer As String, MyNote As String, MyEF As String
Dim ExcludedFiles As Variant
Dim WS As Worksheet
Dim LR As Long
Set WS = ActiveSheet
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Get the folder object associated with the import file
Set objFolder = objFSO.GetFolder(Application.ThisWorkbook.Path)
Application.ScreenUpdating = False: Application.DisplayAlerts = False
' Delete current data to avoid double entries
With WS
If .[a2] <> Empty Then
MyNote = "Current data detected do you want to delete this data to avoid double entries?"
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Delete data?")
If Answer = vbNo Then GoTo StartLoop
LR = .Range("A" & Rows.Count).End(xlUp).Row
With .Range("A2:A" & LR)
.ClearContents
End With
End If
End With
StartLoop:
' Loop through the Files collection and import values from each workbook from cell I4 on Effektivitet sheet
For Each objFile In objFolder.Files
' Exclude workbook running the code from the loop
If objFile <> ThisWorkbook.FullName Then
Dim source As Workbook
Set source = Application.Workbooks.Open(objFile.Path, ReadOnly:=True)
If WorksheetExists("Effektivitet") Then
Set ImpVal = source.Worksheets("Effektivitet").[I4] 'Range that are imported
If Not ImpVal Is Nothing Then
WS.[A500].End(xlUp).Offset(1).Value = ImpVal.Value 'Insert range on first empty row in colomn A
IncludedFiles = IncludedFiles & ", " & ActiveWorkbook.Name
End If
Else
ExcludedFiles = ExcludedFiles & ActiveWorkbook.Name & " "
End If
source.Close
Set source = Nothing
End If
Next objFile
Set objFolder = Nothing
Set objFile = Nothing
Set objFSO = Nothing
'Show which files weren't succesfully imported from the source folder
If ExcludedFiles <> Empty Then
MyEF = "The following files wasn't imported succesfully: " & ExcludedFiles
MsgBox MyEF, vbExclamation, "Some files didn't fit the criterias for importing values"
End If
Application.DisplayAlerts = True: Application.ScreenUpdating = True
End Sub
Function WorksheetExists(WSName As String) As Boolean
On Error Resume Next
WorksheetExists = Worksheets(WSName).Name = WSName
On Error GoTo 0
End Function
Bookmarks