Hi, i built a macro to print from several files and sheets as pdfs, which is working fine. However, I wanted to specify the page/print setup orientation (portrait vs. landscape). I was hoping the below would work by specifying the preferred orientation in column G (e.g cell G5 will say "Landscape", but it didn't. Can someone confirm that the below thinking wouldn't work? Is there a way I can achieve that without doing a couple of IF statements?
Code:
Layout = Range("G" & i).Value
wsa.PageSetup.Orientation = xl & Layout