I have an Excel file where i want to use VBA to insert a column in front of the excising column A. The file contains other VBA's for generate a list. So, the list can change in numbers of columns and rows. I use below VBA to print, it works just fine. But I want it to do like: Press print bottom, the VBA insert a new column A with check boxes. A Msg box pops up and stay on top (Press OK when you are ready to print), then you can select the lines that you want to print in the check boxes. If you don't select any check boxes the print VBA should print all active lines as it do now, except the new column A with check boxes.
Sub Print()
Call Uden_pre_booking 'Starts the VBA that makes a fresh list
Dim ws3 As Worksheet
Dim EndRow As Long, EndCol As Long
Set ws3 = Sheets("Vis_Oversigt")
EndCol = ws3.Cells(4, 6).Value + 10
EndRow = ws3.Range("B" & Rows.Count).End(xlUp).Row + 2
ws3.PageSetup.PrintArea = ws3.Range(Cells(1, 1), Cells(EndRow, EndCol)).Address
ActiveSheet.PrintPreview
End Sub
I have tried several VBA's from different sites, but doesn't manage to get it into a functional VBA.
Hope that someone will help me make a functionally VBA.
Aucun commentaire:
Enregistrer un commentaire