ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB - Relative Refs (https://www.excelbanter.com/excel-programming/388674-vbulletin-relative-refs.html)

Darin Kramer

VB - Relative Refs
 


Howdie,

Im looking for some VB that will, in the column that the cursor is
currently in, select cells 3:180.

So if active cell is in column B when macro is run it will select
b3:b180 and if active cell is in column X when macro is run, it will
select select x3:x180....

Thanks!!!

D

*** Sent via Developersdex http://www.developersdex.com ***

Vergel Adriano

VB - Relative Refs
 
Darin,

Here's one way


Sub test()
With ActiveCell
Range(Cells(3, .Column), Cells(180, .Column)).Select
End With
End Sub


--
Hope that helps.

Vergel Adriano


"Darin Kramer" wrote:



Howdie,

Im looking for some VB that will, in the column that the cursor is
currently in, select cells 3:180.

So if active cell is in column B when macro is run it will select
b3:b180 and if active cell is in column X when macro is run, it will
select select x3:x180....

Thanks!!!

D

*** Sent via Developersdex http://www.developersdex.com ***


Darin Kramer

VB - Relative Refs
 

Thanks! Works perfectly!


*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 05:03 AM.

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