![]() So I figured that it must have something to do with the xRng2.Copy part and how to copy to a new empty column I'm not sure. Ok so I searched and found the answer to one page but I have one small issue: At the moment when the macro runs it copies the first selection then the second in subsquential rows and I want it to be in a new column instead. VbQuestion + vbYesNo, "Print celected cells") = vbNo Then Exit Sub If MsgBox("Are you sure you want to print " & _ If cCount < 10 Then ' less than 10 cells selected Then click Kutools Plus > Printing > Print Specific Pages, see screenshot: 3. NWB.Close False ' close the temporary workbook without saving Activate the worksheet which you want to print some specific pages. PasteSpecial Paste:=xlFormats, Operation:=xlNone, _ ![]() PasteSpecial Paste:=xlValues, Operation:=xlNone, _ With Range(aRange) ' pastes values and formats Set NWB = Workbooks.Add ' create a new workbook ' find the column width of every column in the selection ' find the row height of every row in the selection If you wish to print the native gridlines, select Page Layout (tab) -> Sheet options (group) -> Gridlines -> Print. RCount = (xlLastCell).RowĬCount = (xlLastCell).Column Or, you can set up and save a print area in Excel if you plan to print the same section often. If aCount > 1 Then ' multiple areas selectedĪpplication.StatusBar = "Printing " & aCount & " selected areas." If you’re not happy with the preview of your sheet on a single page, remember that you can always print a specific selection of cells in Excel instead. If aCount = 0 Then Exit Sub ' no cells selected If UCase(TypeName(ActiveSheet)) "WORKSHEET" Then Exit Sub ' prints selected cells, use from a toolbar button or a menuĭim aCount As Integer, cCount As Integer, rCount As Integerĭim i As Integer, j As Long, aRange As Stringĭim rHeight() As Single, cWidth() As Single I am a bit lost as to what to add to the following to make it work: So I am using a VBA to print out a multiple selection and at this stage it is causing me issues as it wont shrink to fit one page.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |