ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB Script XL - Range Selection (https://www.excelbanter.com/excel-programming/439130-vbulletin-script-xl-range-selection.html)

Servant63

VB Script XL - Range Selection
 
I'm new to Scripting in Excel and trying to select a Range of cells beginning
at B13... want to End-down and then go right 23 cells and have that range
active to print... Closest I've come is
Range ("B13".End(xlDown)).Right 23.Activate {I've thrown in Right 23 as I
don't know how to include that part}... thanx in advance...

Chip Pearson

VB Script XL - Range Selection
 
Try

Range("B13").End(xlDown)(1, 24).Activate

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Tue, 2 Feb 2010 13:59:01 -0800, Servant63
wrote:

I'm new to Scripting in Excel and trying to select a Range of cells beginning
at B13... want to End-down and then go right 23 cells and have that range
active to print... Closest I've come is
Range ("B13".End(xlDown)).Right 23.Activate {I've thrown in Right 23 as I
don't know how to include that part}... thanx in advance...


Opa Horst

VB Script XL - Range Selection
 
Close :) Split the command in two, first get the last row:
Lastrow = Range(Cells(13,ColNbr),Cells(13,ColNbr)).End(xlDow n).Row
Then go right:
Cells(Lastrow,ColNbr+23).Activate


"Servant63" wrote:

I'm new to Scripting in Excel and trying to select a Range of cells beginning
at B13... want to End-down and then go right 23 cells and have that range
active to print... Closest I've come is
Range ("B13".End(xlDown)).Right 23.Activate {I've thrown in Right 23 as I
don't know how to include that part}... thanx in advance...



All times are GMT +1. The time now is 02:35 AM.

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