Copy Selection to multiple worksheets except two

emmetje

New Member
Joined
Feb 12, 2014
Messages
12
Can someone please review the last part of this code? The macro only selects the range but doesn't copy it to the worsheets as I want it to.

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
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

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