Help with vba printout formulas

PANDA777

New Member
Joined
Aug 14, 2022
Messages
13
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hi I have a print input sheet with 3 cells to enter a number into.
Each input cell is linked to cell"C10" on each of the worksheets "1A""1B" & "1C"
I want to be able to link a vba code to a button to be able to only print out all sheets with numbers inputted.
eg. it would be 2 sheets printed only as per the input sheet below


1660680571105.png
1660681404934.png



The following formula below is in worksheet "A1" on the the cell c10 highlighted

=IF(Input!G43="","",Input!G43)

The following below code prints all three sheets out even if one of the input numbers is blank. I Think the Isempty statement is interpreting "" as a value
and therefore thinks it isn't empty.

Is there a way to fix this??

I'd also like the entry cells on the input sheet which printout to turn light green to reflect confirmation they've been sent to the printer if possible.

Here's the button code so far :

Sub Button32_Click()
Dim idx As Integer
Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
If Not IsEmpty(ws.Range("c10").Value) Then
ws.PrintOut
End If
Next
End Sub

Much appreciate any help
 
Thank you so much!!!!! thats it! works perfect. Really appreciate your time and patience.

Best Regards
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

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