ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset Question (https://www.excelbanter.com/excel-programming/376253-offset-question.html)

Craig McK

Offset Question
 
Hi

have the following line in a macro, but now need it to go to column "A" all
the time to pick up some data, how do I force it to a specific column, but
stay on the same row?

Just to confirm the "rng.Address" could be anything from column B ~ X

Range(rng.Address).Offset(rowoffset:=0, Columnoffset:=2).Activate



Gizmo63

Offset Question
 
Range("A" & activecell.row()).select

HTH
Giz

"Craig McK" wrote:

Hi

have the following line in a macro, but now need it to go to column "A" all
the time to pick up some data, how do I force it to a specific column, but
stay on the same row?

Just to confirm the "rng.Address" could be anything from column B ~ X

Range(rng.Address).Offset(rowoffset:=0, Columnoffset:=2).Activate



Dave Peterson

Offset Question
 
Here are a couple of ways:

rng.entirerow.cells(1).activate
or
cells(rng.row,1).activate

If rng is on the activesheet, then there's no reason to use range(rng.address).



Craig McK wrote:

Hi

have the following line in a macro, but now need it to go to column "A" all
the time to pick up some data, how do I force it to a specific column, but
stay on the same row?

Just to confirm the "rng.Address" could be anything from column B ~ X

Range(rng.Address).Offset(rowoffset:=0, Columnoffset:=2).Activate


--

Dave Peterson


All times are GMT +1. The time now is 10:22 PM.

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