#How to change print area in excel code
In fact, the bulk of the script doesn’t even have anything to do with setting the print area that code is there simply to add some data to the spreadsheet, making it a little more obvious what it means to set the print area. = “B2:D4”Īs you can see, this isn’t the most complicated script in the world. Set objWorksheet = objWorkbook.Worksheets(1)
And then there are the weeds that need to be pulled, the doughnuts that need to be bought and, well, here’s the deal: you can’t really break a promise if you never actually made that promise, now can you? With that in mind, the Scripting Guy who writes this column feels only a little guilty about the following script, one that sets the print area in an Excel spreadsheet: Set objExcel = CreateObject(“Excel.Application”) On top of that, sometimes the Scripting Car works and sometimes it doesn’t that means the Scripting Guy who writes this column has to deal with mechanics, weigh the pros and cons of buying a new car, and has to venture out of Scripting Guys headquarters to actually look at new cars.
#How to change print area in excel full
(Does that mean he came in at 3:00 AM in order to put in a full 8-hour day? Well, kind of ….) But sometimes the Scripting Son plays in a baseball tournament, and the Scripting Guy who writes this column needs to sneak out of the office by 11:00 AM or so if he wants to attend the game. In his defense, he usually tries to live up to those ideals anyway. At any rate, had he chosen to take such a vow the Scripting Guy who writes this column would likely have vowed to never take shortcuts to always work extremely hard when answering a question to never take, say, 3 minutes to write a script and then try to pass that off as a full column.