VBA Print code printing the wrong worksheet

ryeire

New Member
Joined
Jan 31, 2022
Messages
31
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have a vba file for logging information and printing a worksheet with the logged info. However, there is a problem with the printing: the code prints the previously logged info instead of the info I've just logged (e.g. it prints the second last set of information instead of the last one) or the printed worksheet is blank. The code does work as it is intended to sometimes, but most of the time the worksheet that prints is blank or it has the wrong info.

I'm hoping someone can help me resolve this problem.

I have attached images of the information worksheet, the template worksheet, the form for logging information, the form for printing and the code for the form for printing. The code is in two images as it would not fit into one.

TCO_worksheet.pngTCO_template.pngTCO_form.pngTCO_printform.png
Print_code.png
Print_code2.png
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top