Can someone please help me?
In the last part of the code I want to copy a selection from 1 worksheets to all other worksheets except two. But the macro stops at the selection and doesn't copy at all. I get no error message. Can someone please tell me what the correct code should be?
Thx.
Sub VakantiekaartenNaarNieuwJaar()
'
' VakantiekaartenNaarNieuwJaar Macro
'
' Keyboard Shortcut: Ctrl+k
'
'OPEN BESTAND
Workbooks.Open Filename:= _
"LOCATION\2014.xls", _
UpdateLinks:=0
'BEVEILIGING WERKBLADEN OPHEFFEN
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="PASSWORD"
Next ws
'
'JAARTAL INVOEREN
'
Sheets("Totaal").Select
Range("B3:G3").Select
ActiveCell.FormulaR1C1 = "2014"
Range("B4").Select
'
'BASISBESTAND OPENEN, BLANCO KAART NAAR HUIDIG BESTAND KOPIEREN EN BASISBESTAND SLUITEN
'
Workbooks.Open Filename:= _
"LOCATION\_Vakantiekaartenbestand 2014.xls"
Windows("_Vakantiekaartenbestand 2014.xls").Activate
Sheets("Blanco kaart").Select
Sheets("Blanco kaart").Copy Before:=Workbooks("2014.xls").Sheets("Totaal")
Windows("_Vakantiekaartenbestand 2014.xls").Activate
Windows("_Vakantiekaartenbestand 2014.xls").Close False
'
'RELEVANTE CELLEN UIT BLANCO KAART KOPIEREN NAAR ALLE WERKBLADEN IN HUIDIG BESTAND
'
Workbooks("2014.xls").Activate
Sheets("Blanco kaart").Activate
Range("Y4:Z10").Select
For Each ws In Workbooks("2014.xls").Worksheets
If ws.Name <> "Blanco kaart" And ws.Name <> "Totaal" Then
Selection.Copy Destination:=ws.Cells(Selection.Row, Selection.Column)
End If
Next
End Sub
In the last part of the code I want to copy a selection from 1 worksheets to all other worksheets except two. But the macro stops at the selection and doesn't copy at all. I get no error message. Can someone please tell me what the correct code should be?
Thx.
Sub VakantiekaartenNaarNieuwJaar()
'
' VakantiekaartenNaarNieuwJaar Macro
'
' Keyboard Shortcut: Ctrl+k
'
'OPEN BESTAND
Workbooks.Open Filename:= _
"LOCATION\2014.xls", _
UpdateLinks:=0
'BEVEILIGING WERKBLADEN OPHEFFEN
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="PASSWORD"
Next ws
'
'JAARTAL INVOEREN
'
Sheets("Totaal").Select
Range("B3:G3").Select
ActiveCell.FormulaR1C1 = "2014"
Range("B4").Select
'
'BASISBESTAND OPENEN, BLANCO KAART NAAR HUIDIG BESTAND KOPIEREN EN BASISBESTAND SLUITEN
'
Workbooks.Open Filename:= _
"LOCATION\_Vakantiekaartenbestand 2014.xls"
Windows("_Vakantiekaartenbestand 2014.xls").Activate
Sheets("Blanco kaart").Select
Sheets("Blanco kaart").Copy Before:=Workbooks("2014.xls").Sheets("Totaal")
Windows("_Vakantiekaartenbestand 2014.xls").Activate
Windows("_Vakantiekaartenbestand 2014.xls").Close False
'
'RELEVANTE CELLEN UIT BLANCO KAART KOPIEREN NAAR ALLE WERKBLADEN IN HUIDIG BESTAND
'
Workbooks("2014.xls").Activate
Sheets("Blanco kaart").Activate
Range("Y4:Z10").Select
For Each ws In Workbooks("2014.xls").Worksheets
If ws.Name <> "Blanco kaart" And ws.Name <> "Totaal" Then
Selection.Copy Destination:=ws.Cells(Selection.Row, Selection.Column)
End If
Next
End Sub