Macro won't execute

Peltz

Board Regular
Joined
Aug 30, 2011
Messages
87
Hello.

Uing excel 2003, suddently my macro won't execute. The problem started when I put in a new line (a pastespecial commnd) into the code. I dont get a error message, the debugger doesn't kick in. Just nothing. I removed my new line, saved, opened again (promted for activate macro and accepted), still nothing. I shut down excel, restarted computer. Nothing. Ive trippledchecked my security settings, everything looks fine as far as I can see. By the way, no macro in that woorbokk runs. Makros in other workbooks run...

BTW, here's the code. Worked just fine a hour ago.
Code:
 Sub Slette1()
' Slette1 Makro
' Makro registrert 04.08.2014 av jhetland
'
Dim Teamarbeid As Workbook, Pasientliste As Workbook
If Sheets("Behandlingsavdelingen").Range("Q7").Value = "B" Then
Workbooks.Open ("F:\Utkast\Teamarbeid (Jenskladd)\Teamarbeid.xls")
Set Teamarbeid = Workbooks("Teamarbeid.xls")
' Set TeamA = Workbooks ("TeamarbeidA.xls")
' Set TeamB = Workbooks ("TeamarbeidB.xls
Set Pasientliste = Workbooks("Pasientliste.xls")
' IF Range("Q7").Value = B
Teamarbeid.Activate
    Rows("25:25").Select
    Selection.Insert Shift:=xlDown
    Range("A5:AI5").Select
    Selection.Copy
    Range("A25:AI25").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
Pasientliste.Activate
 Range("A7:D7,F7:T7").Select
 Range("A7").Activate
 Selection.ClearContents
 Teamarbeid.Close SaveChanges:=True
End If
End Sub

Would love to put in a pastespecial with all the conditional formats... but thats of secondary importance right now!



Anyone?
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
AHHH solved

The code is case sensitive, I used a "b" instead of a "B".... sorry.

Is there any way I can delete thread or edit the name of the tread?
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,652
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top