Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2005, 01:27 AM
ct ct is offline
Authorized User
 
Join Date: Aug 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default print column by column

can u help me...i want to create a button to print a spreadsheet in excel..but i have to print column by column....for example from column A1 UNTIL column Z786...how i want to do it..can u help me..

and..
i also have a problem to write a coding which is in one button i have to print 3 sheet all together and at the same time i have to specified it column by column...can u help me..
tq

 
Old August 8th, 2005, 07:21 AM
Authorized User
 
Join Date: Feb 2005
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ct,

I'm not sure if I understand your problem correctly, but I'll give it a shot. You would like to print every column on a separate paper, and do it all automatically by VBA code. Try this,

Sub printcolumns()
'
For i = 1 To 3 'loop for three sheets
    Sheets(i).Select
    For j = 1 To 26 'all columns
        With Sheets(i)
            .Range(.Cells(1, j), .Cells(786, j)).Select
        End With
        ActiveSheet.PageSetup.PrintArea = ""
        ActiveSheet.PageSetup.PrintArea = Selection.Address
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
    Next j
Next i
'
End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
previous column & next column ct Excel VBA 4 August 19th, 2005 04:50 AM
How to NOT print crosstab column headers chan Crystal Reports 0 August 11th, 2005 05:29 AM
template column and bound column hidayah ASP.NET 1.x and 2.0 Application Design 1 April 9th, 2005 03:50 PM
Please Help Print a column from a row from a datag macupryk Javascript 1 October 31st, 2004 06:52 PM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.