ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   When you select a range with a macro (https://www.excelbanter.com/excel-programming/284102-when-you-select-range-macro.html)

Patrick[_6_]

When you select a range with a macro
 
Hello,

When you select a range with a macro, via End xldown etc... I would like to
select this range minus 1 column, how is this possbiel in excell

Regards

Patrick



Bob Phillips[_6_]

When you select a range with a macro
 
Patrick,

Use Resize. Assuming that you have set the selected range to a variable
called tbl, this will cut back 1 column

tbl.Resize(tbl.Rows.Count, _
tbl.Columns.Count - 1).Select


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Patrick" wrote in message
. be...
Hello,

When you select a range with a macro, via End xldown etc... I would like

to
select this range minus 1 column, how is this possbiel in excell

Regards

Patrick





patrick molloy

When you select a range with a macro
 
DIM Cell as Range

SET Cell = Range("B65000").End(xlUp).Offset(0,-1)


Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Hello,

When you select a range with a macro, via End xldown

etc... I would like to
select this range minus 1 column, how is this possbiel

in excell

Regards

Patrick


.



All times are GMT +1. The time now is 09:10 AM.

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