ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   set print area for variable number of columns (https://www.excelbanter.com/excel-programming/397197-set-print-area-variable-number-columns.html)

CAB horse

set print area for variable number of columns
 
Excel 2002
Hi I want to create a macro to set the print area on a worksheet where the
number of columns will vary. I've tried adapting the advice on setting for
variable rows but get run errors, usually 424. My knowledge of VBA is not
good so please could you keep it simple for me.
Many thanks

JW[_2_]

set print area for variable number of columns
 
What criteria needs to be used inorder to establish the number of
columns that need to be set in the print area?
CAB horse wrote:
Excel 2002
Hi I want to create a macro to set the print area on a worksheet where the
number of columns will vary. I've tried adapting the advice on setting for
variable rows but get run errors, usually 424. My knowledge of VBA is not
good so please could you keep it simple for me.
Many thanks



CAB horse

set print area for variable number of columns
 
The data is filtered and copied-special-transpose into the €śResults€ť sheet.
This is done by a macro. There can be anything from 2 to 50+ columns,
depending on the request. I want to be able to set the print area to include
all the filled columns. This workbook will be used by volunteers, many of
whom have few computer skills and no experience of Excel, so everything has
to be set up to work with the minimum of user intervention. Without me
setting the print area, they are likely to print off dozens of blank sheets.
Hope this makes it clear, thanks for your response


"JW" wrote:

What criteria needs to be used inorder to establish the number of
columns that need to be set in the print area?
CAB horse wrote:
Excel 2002
Hi I want to create a macro to set the print area on a worksheet where the
number of columns will vary. I've tried adapting the advice on setting for
variable rows but get run errors, usually 424. My knowledge of VBA is not
good so please could you keep it simple for me.
Many thanks





All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com