I am working on a excel project for work that is a schedule of jobs for the week. I have VBA code to add a new job and thanks to help on here I now have a button to delete completed jobs. My last problem is I want to have a button to print rows that only have data in them or only print certain cells say the first couple cells that have specific detail about the job. I know that it would be easy to do with a sort or filter but this is for a office that the ones that will be using this aren't that Excel literate so I am trying to make it as easy as possible to use that is why the print button. I have hacked together a bit of code that not surprisingly doesn't work. I have a sheet called Schedule and I want to print columns A to H and only print the rows that contain data not the empty rows. I know this code isnt correct but I am grasping at straws here so any help would be greatly appreciated.
Code:
Sub Rectangle4_Click()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
ThisWorkbook.VBProject.VBComponents("Schedule").Export "test.txt"
Workbooks.OpenText "test.txt"
With ActiveSheet
.Cells.Font.Name = "Courier"
.PageSetup.LeftMargin = Application.InchesToPoints(1)
.Cells.PrintOut
End With
ActiveWorkbook.Close
Kill "test.txt"
.DisplayAlerts = True
.ScreenUpdating = True
End With
End Sub