Quantcast
Channel: Spiceworks Community
Viewing all articles
Browse latest Browse all 40

VB macro doesn't work right in Office 2013

$
0
0

Ignoring the fact that it is badly written, it should still work. The structure is identical for each worksheet and works for the first 2 sheets so it looks like it is not finding a match (y or Y) for the 3rd & subsequent sheets. Since it works for PDF it does not look like an 'activesheet' issue so the only remaining possibility appears to be the y/Y values but I assume they are entered correctly. Very odd. As others have said, set a breakpoint and step through the code to find out what is happening.

It is possible that it is not a VBA issue at all, maybe something odd happening when you send multiple sheets to the printer. To test, paste the Sub below and run it to print all sheets in the workbook.

Sub PrintAllSheets()

Dim sht As Worksheet
For Each sht In ThisWorkbook.Worksheets
sht.PrintOut
Next sht

End Sub


Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>