Hi there, this is driving me nuts.
I Changed location of a couple of files and now suddently I got an error?!
Now. The code is launched from Pasientliste.xls. The code also opens Teamarbeid.xls. However, I get the subscript out of range!! Whats happening here? The debugger kicks in at the IF statement...
Thanks
I Changed location of a couple of files and now suddently I got an error?!
Code:
Sub Slette1()
'
' Slette1 Makro
' Makro registrert 04.08.2014 av jhetland
'
Dim Team As String
Team = "F:\Utkast\Teamarbeid (Jenskladd)\Teamarbeid.xls"
Workbooks.Open Team, UpdateLinks:=True
If Workbooks("Pasientliste").Sheets("Behandlingsavdelingen").Cells(7, 1).Text = Workbooks("Team").Sheets("Ark3").Cells(25, 1).Text Then
Range("A7:D7,F7:T7").Select
Range("F7").Activate
Selection.ClearContents
Workbooks("Teamarbeid").Close SaveChanges:=True
Else
Application.Run "Teamarbeid.xls!Pas1"
Range("A7:D7,F7:T7").Select
Range("F7").Activate
Selection.ClearContents
Workbooks("Teamarbeid").Close SaveChanges:=True
End If
End Sub
Now. The code is launched from Pasientliste.xls. The code also opens Teamarbeid.xls. However, I get the subscript out of range!! Whats happening here? The debugger kicks in at the IF statement...
Thanks