Hi All
I have all my codes and it work fine. Just that i add on 2nd sheet, named "HBL".
While i click the button on 1st sheet, i thought that excel will save my 2nd sheet too. But excel don't.
Please assist or advise me on this. How to alter my code.
Meantime, it is much appreciated to teach, advise and guide me, how to run VBA on a specific sheets only. (Example, clear contents from different range and sheet 2 will be different as well.
Private Sub Workbook_Open()
Sheets("To-do list").Protect _
Password:="q1w2e3r4", _
UserInterfaceOnly:=True
End Sub
Sub SaveScreeningWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "C:\Users\CYCHUA\Documents\JobScreening\" & Range("c2").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextScreening
End Sub
Sub NextScreening()
Range("C2").Value = Range("C2").Value + 1
Range("B5:L15").ClearContents
Range("D19:G34").ClearContents
Range("D35:F57").ClearContents
Range("G40:G41").ClearContents
Range("G46:G47").ClearContents
Range("C4").ClearContents
Range("I1").ClearContents
End Sub
1. Saving 2 Sheets in new copy instead of 1 Sheet, without sheet2 - Done
2. Clearing Sheet2 contents with VBA. Done
3. Creating PDF File with macro button on Sheet 2 and save a copy to specific folder. (Do have the code, but not doing right)
4. Print out "Sheet 2" (HBL) with macro button. When the form is being filled up on page 2- Sheet2(HBL), then only print out Page 1 and page 2 on Sheet2(HBL)
Bookmarks