I've created a macro using the record function included in excel to copy information from one sheet to another.
Explanation:
Column A of worksheet A needs to be copied to column A of worksheet B Column B of worksheet A needs to be copied to column B of worksheet B Column I of worksheet A needs to be copied to column C of worksheet B Columns K & J of worksheet A need to be copied to column E of worksheet B
The script below only works in a specific range. Is it possible to let the range depend on the datarange of worksheet A (so pe if the values go from row 1 to row 589, just copy those rows to worksheet B?)
Script so far included below.
Thanks in advance :)
Sub Hulpwerkblad()
'
' Hulpwerkblad Macro
'
' Sneltoets: Ctrl+Shift+H
'
Sheets("Hulpwerkblad").Select
Range("A1").Select
ActiveCell.FormulaR1C1 = "='samenvattende meetstaat'!RC"
Range("B1").Select
ActiveCell.FormulaR1C1 = "='samenvattende meetstaat'!RC"
Range("C1").Select
ActiveCell.FormulaR1C1 = "='samenvattende meetstaat'!RC[6]"
Range("E1").Select
ActiveCell.FormulaR1C1 = _
"=CONCATENATE('gedetailleerde meetstaat'!RC[6],'gedetailleerde meetstaat'!RC[5])"
Range("E2").Select
Columns("E:E").EntireColumn.AutoFit
Range("A1").Select
Selection.AutoFill Destination:=Range("A1:A33"), Type:=xlFillDefault
Range("A1:A33").Select
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:B33"), Type:=xlFillDefault
Range("B1:B33").Select
Range("C1").Select
Selection.AutoFill Destination:=Range("C1:C33"), Type:=xlFillDefault
Range("C1:C33").Select
Range("E1").Select
Selection.AutoFill Destination:=Range("E1:E33"), Type:=xlFillDefault
Range("E1:E33").Select
End Sub