Hi all,
Please help to simply the macro codes below:
Code
Private Sub CheckBox1_Click()Dim wsTarget As Workbook
Dim wsSource As Workbook
Dim rngSource As Range
Dim rngTarget As Range
Dim wbname As String
With Excel.Application
.ScreenUpdating = False
.Calculation = Excel.xlCalculationManual
End With
wbname = "C:\\My Documents\Blotter\Master.xlsm"
Set wsSource = ActiveWorkbook
Set wsTarget = Workbooks.Open(wbname)
Worksheets("Master").Select
Worksheets("Master").Range("B6").Select
Set rngSource = wsSource.Sheets("Blotter").Range("B7:O7")
Set rngTarget = Worksheets("Master").Range("B" & (Worksheets("Master").Range("B65536").End(xlUp).Row + 1))
If CheckBox1.Value = True Then
rngSource.Copy
rngTarget.PasteSpecial xlPasteValues
wsSource.Worksheets("Blotter").Activate
End If
wsTarget.Close True
With Excel.Application
.ScreenUpdating = True
.Calculation = Excel.xlAutomatic
.CutCopyMode = False
End With
End Sub
Display More
The code basically works well, however it increase the size of the file. The code goes on till 50 checkboxes in each row starting at Row 6.
Hope you can help me with this to tidy up and speed up the processes.
Thank you in advance.