ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add a column to a selection (https://www.excelbanter.com/excel-programming/311325-add-column-selection.html)

pam

Add a column to a selection
 
I have a spreadsheet that has data in columns A - D in a
varying number of rows. It may or may not contain data
in Column E. I want to print columns A - E.

I can write a macro to select the data in columns A - D
using: Range (("A4"), range("D4").end(xlDown)).Select

How do I select this additional column (column E) also?
..



Ron de Bruin

Add a column to a selection
 
Hi Pam

Range(("A4"), Range("E" & Range("D4").End(xlDown).Row)).Select

You can use this to print this range

Range(("A4"), Range("E" & Range("D4").End(xlDown).Row)).PrintOut


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Pam" wrote in message ...
I have a spreadsheet that has data in columns A - D in a
varying number of rows. It may or may not contain data
in Column E. I want to print columns A - E.

I can write a macro to select the data in columns A - D
using: Range (("A4"), range("D4").end(xlDown)).Select

How do I select this additional column (column E) also?
.






All times are GMT +1. The time now is 07:33 AM.

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