Macro for printing spreadsheets
Hello
Is there any option (formula or macro) in Excel that allows you to print one sheet of another without opening it.
Example: If there are 5 sheets, can print us sheet-2 or 3 or 4 or 5 on worksheet 1 itself, individually (not print all sheets).
If so, please provide the same.
Thanks in advance
Hey! I had found the answer...
We can use the macro by giving the VBA code...
We have an option to print either the entire workbook by using the following VBA code
Void PrintAllSheets()
'
Dim M As Long, N As Long, Firstsht as long, Lastsht As Long, sheet As Object
'
Lastsht = Sheets.Count
M = 0: N = Lastsht
'
For each sheet in the sheets
If not Sheet.Visible then N = N - 1
If Sheet.Visible and Sheet.Type = xlWorksheet Then
If case (Sheet.UsedRange) = 0 Then
N = N - 1
End If
End If
Next
'
Firstsht = 1 to Lastsht
'
If Sheets (Firstsht). Visible = True Then
'
If not TypeName (Sheets (Firstsht)) = "Chart" then
If case (Sheets (Firstsht). UsedRange) <> 0 Then
M = M + 1
GoSub DoPrint
End If
Else ' otherwise it's a chart
M = M + 1
GoSub DoPrint
End If
'
End If
'
Next ' Firstsht
Exit Sub
DoPrint:
With Sheets (Firstsht). PageSetup
. CenterHeader = "& F! & one ".
. CenterFooter = "Page" & CStr (M) & "of" & N
. RightFooter = "?" & CStr (Year (Date))
. FitToPagesWide = 1
. FitToPagesTall = 1
Ends with
Associated with the Application
. EnableEvents = False
Sheets (Firstsht). PrintPreview '. Print
. EnableEvents = True
Ends with
Return
End Sub
Otherwise, we can create a macro that leads to give the name of the excel sheet, we need to print... the following vba code helps us create the macro
Void Button92_Click()
Dim Nom_feuille As String
Nom_feuille = Application.InputBox ("enter a sheet name")
Sheets (sheetName). Print
End Sub
How to use vba code is
ALT + F11--> Insert--> Module--> copy the code above and paste the same--> Alt + Q
In the Excel worksheet.
In developer--> tab insert controls on a form--> button-->
Click the button and it prompts to select the Macro, we created.
(In the absence of the Developer tab, file--> options Excel--> Popular--> Show Developer tab in the Ribbon.) (Check the same and the tab will be displayed)
Concerning
Janaki
Tags: Windows
Similar Questions
-
Does anyone know how to merge two workseets number for printing?
How can I combine two spreadsheets in numbers for printing?
Hi jj,
I assume that you mean that you have a single document, which contains two worksheets, and that each sheet contains one table (only?).
What do you mean by "merge two (booklets)?
You mean you wan to place Tables of two leaves on a single sheet (this sheet would contain then both tables).
Or do you mean you want to place all data on the two tables into a single table on one sheet?
Or do you mean something different to both of these descriptions?
Kind regards
Barry
-
My album will not download for printing
I created an album with Photos, but when I order the album program is unable to complete the download. Either it stops at 54 percent, or 103 percent.
are you trying to order a photobook Photos or prints of your photos? l don't know what you mean by "album for printing.
IF you try to order a book, you have created a PDF preview? Is the preview OK, or it also crashes?
you have any firewalls or active antivirus software, which could be to intercept the connection to Apple?
-
Add-on for Print Edit does not work
I just got my iMac cleaned for adware and now my add-on for print edit does not work. There is an error 2 - XPF to the catalog. I don't know the email address of support for developers?
Hello
Did you mean this extension:
The contact details are on the right side of the page, next to the section 'on this add-on.
-
My mac says "Looking for printer.
I bought D110a yesterday, and after a few soft not to install this printer on my Mac (OS X 10.6.4), I finally got to print... However, not always. By 'not always' I mean a point print at a time, through "reboot" the printer between the prints. If I do not "restart" the printer, the print queue displays "Looking for printer...» ». It will remain in this State indefinitely. When I try to use the HP utility, I get the following message: "HP ink jet is currently unavailable. Please check if it is connected and turned on, or try again later. »
The printer is powered on and connected. I can access the built-in Web server (which displays the status "Ready"), and the "Print and Fax" menu shows the printer as "Idle" with the green light.
Some useful facts (?):
I installed this printer using the HP software provided.
This printer is used on my wireless network (Linksys WRT610n router)
I have another printer wireless that works without problem.
Someone at - it no indication on this topic?
Uninstall the HP software by using its own uinstaller (in Applications > Hewlett-Packard).
Restart your Mac.
Download and install this: http://support.apple.com/kb/DL907
Download the latest version of the software for your printer from the "Support & drivers" link at the top of this page.
-
I need keyboard shortcut for "print preview" - tanks
Hello
I need a shourtcut to keyboard for "print preview."
tanks.You can use this addon
-
Highlighting of certain parts of the Web page for printing
I have a problem highlighting items to save to a file for printing of Web pages (specifically the text). If I pressed the left mouse button to highlight the text, the page is not auto scroll where the text is off the screen. An example is here:
http://sonalacant.blogspot.com/search/label/agendaIdeas please, because it means I have to go back to IE for certain pages?
Click on the first letter of the syntax you want to save (you will see nothing appear on the screen), then scroll down to the last letter of the sentence or paragraph, hold the SHIFT key and click on it. This will highlight everything between the two. Then CTRL + C to copy.
Works in any browser or document.
-
Want 5660: want manual user for printer HP 5660
I just got this printer and would like some instructions on how it works. That is to say: how to change printer of color to B & W or vice versa. How to set up for printing images on smaller print - etc.
Hello
Copy the following pdf file:
http://h10032.www1.HP.com/CTG/manual/c04425658.PDF
Several manuals:
Kind regards.
-
How can I access the album artwork for printing on a CD? It is used to be simple, that now I can not find anything
(Retina Powerbook 15, OSX 10.11.2, Itunes 12.3 2.35)
Right-click on the right track... Get info... Select album art... Drag it to the desktop
print it from there.
-
HP 8630 will authorize specifying the second tray for printing shortcut.
All-in-one printer inkjet HP 8630 range Pro will not accept specifying the second tray for printing shortcut. Indicates that the parameter is a conflict and obliges the "Printer Auto Select" option instead of allowing me to select "tray 2" which is an option. I like to keep a white shining in tray one and photo paper in tray 2 and made the my HP 8500 Pro for everything that I needed to do is select the appropriate shortcut configured by me to print the photo. Operating system is windows XP Pro.
I want to start by apologizing for not picking up on this on your first post. The 8630 2nd tray print 8.5 x 11 or 8.5x14 paper.
The reason why what impression pictures he says that there is a conflict and if he chooses the main tray is because there is no choice. The printer does not have the ability to print photos from the 2nd drawer. If you're looking to load media into the trays you need 8.5x11 or 8.5x14 in the 2nd tray and other media can be loaded in the main tray.
In the printer's Specifications in paper output specifications > paper tray capacity & Supported sizes of paper in you shows what's available for trays.
Change the source of your document must make all the problems disappear.
Kind regards
-
copy 2 columns of figures for printing
I have a table rows 950 long I want to copy two of the columns to the pages for printing (that I can't be able to print only two columns in number).
This seems to be fine except when I paste (using the ' paste the results of the formulas), I only see these columns on page 1. When the columns move on page 2 and beyond there is just an empty space. That said, the rule of the table with two columns is visible, but not cells.
How do I see the columns on page 2 and beyond?
Select the table in the Pages. Tab rearrange the text Inline with text wrapping and the Placement of the object is to move with the text. This will leave the table with two columns spread on the following pages, and not truncated at the bottom of the first page.
-
WiFi link for printer EPSON-750 does not work
WiFi link for printer EPSON-750 does not work. In spite of reset the WiFi on the printer and reset the EPSON 750 as default printer on the IMac, the connection between the iMac and the printer does not work
Have you also tried to restart the router?
-
How flip you a photo for printing on transfer papar
I want to print a photo from my photo gallery on transfer paper to be applied to a piece of cloth. I don't see where I do reverse - just say I want to print on transfer paper.
You tried to paste how flip you a photo for printing on transfer paper in yahoo search? I just do.
It's the first thing you need to do if you have a question about an individual.
UTC/GMT is 02:35 Friday, June 22, 2012
-
Windows 2008 rl2 have project option police for printer drivers lq 2180?
Windows server 2008 rl2 have font project for printer lq 2180 pilots and other types of printer? How can we have this option?
Hello
The question you have posted is related to professional level support. Please visit the link below to find a community that will support what ask you:
http://social.technet.Microsoft.com/forums/en/category/WindowsServer/
-
In need of a driver for printer Lexmark 810
Original TitleL: printer not work
looking for a driver for printer lexmark 810 series
The latest drivers Lexmark has are for Vista.
Drivers Lexmark 810:
http://support.Lexmark.com/index?page=productSelectionIf you have Windows 7:
If the manufacturers website has no drivers for Windows 7, try to use Windows Update to install the printer drivers:
http://Windows.Microsoft.com/en-us/Windows7/find-and-install-printer-drivers
Maybe you are looking for
-
I have problems to display the Korean characters.
My Mozilla will display the Korean characters until last week, but now it displays them in the form of the squares with a very small number. I tried all sorts of encodings, but they are not always shown. I am sure that my computers has the support of
-
Hi, I'm trying to find the index of a value in a table, I know that it is a VI called 'research in a 1 d table' but there is my problem: Let's say I'm looking the value 25 and in my series of measurement, there like 24.998 and 25.001 but not 25, this
-
Acer Sb653-5560 maxing out RAM
OK, so based on CNET (and the fact that, in the middle of this announcement, am too lazy to pull the SN of the RAM), this laptop is installed with 2 sticks of DDR3 clocked at 1066 MHz. I know that both these sticks are different manufacturers, but I
-
resizing of icons without loss of quality
Why this is happening with this icon resizing...?Thank you very much
-
In any a MP4 video in my presentation. When I preview the it, the video is automatically (in addition to my narration). How can I set the video to play after my narrative?