ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset of active cell (https://www.excelbanter.com/excel-programming/422316-offset-active-cell.html)

RichardGarfield

Offset of active cell
 
Help please. How do I find the offset of the active cell from the top left
cell in a named range?

Stefi

Offset of active cell
 
Maybe you mean
activecell.Row-range("rngname").Row
activecell.Column-range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Help please. How do I find the offset of the active cell from the top left
cell in a named range?


RichardGarfield

Offset of active cell
 
Hi Stefi

Thanks for the suggestion. It seems that RowRange and ColumnRange only apply
to Pivot Tables. I can't get your code to work for a worksheet range.

Best wishes

Richard

"Stefi" wrote:

Maybe you mean
activecell.Row-range("rngname").Row
activecell.Column-range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Help please. How do I find the offset of the active cell from the top left
cell in a named range?


Stefi

Offset of active cell
 
You misunderstood my post, it has nothing to do with RowRange and ColumnRange.
Subtract range("rngname").Row from activecell.Row for row offset and
subtract range("rngname").Column from activecell.Column for Column offset:

activecell.Row - range("rngname").Row
activecell.Column - range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Hi Stefi

Thanks for the suggestion. It seems that RowRange and ColumnRange only apply
to Pivot Tables. I can't get your code to work for a worksheet range.

Best wishes

Richard

"Stefi" wrote:

Maybe you mean
activecell.Row-range("rngname").Row
activecell.Column-range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Help please. How do I find the offset of the active cell from the top left
cell in a named range?


RichardGarfield

Offset of active cell
 
Many thanks, Stefi

With your help, I've solved it.

Best wishes

Richard

"Stefi" wrote:

You misunderstood my post, it has nothing to do with RowRange and ColumnRange.
Subtract range("rngname").Row from activecell.Row for row offset and
subtract range("rngname").Column from activecell.Column for Column offset:

activecell.Row - range("rngname").Row
activecell.Column - range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Hi Stefi

Thanks for the suggestion. It seems that RowRange and ColumnRange only apply
to Pivot Tables. I can't get your code to work for a worksheet range.

Best wishes

Richard

"Stefi" wrote:

Maybe you mean
activecell.Row-range("rngname").Row
activecell.Column-range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Help please. How do I find the offset of the active cell from the top left
cell in a named range?


Stefi

Offset of active cell
 
You are welcome! Thanks for the feedback!
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Many thanks, Stefi

With your help, I've solved it.

Best wishes

Richard

"Stefi" wrote:

You misunderstood my post, it has nothing to do with RowRange and ColumnRange.
Subtract range("rngname").Row from activecell.Row for row offset and
subtract range("rngname").Column from activecell.Column for Column offset:

activecell.Row - range("rngname").Row
activecell.Column - range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Hi Stefi

Thanks for the suggestion. It seems that RowRange and ColumnRange only apply
to Pivot Tables. I can't get your code to work for a worksheet range.

Best wishes

Richard

"Stefi" wrote:

Maybe you mean
activecell.Row-range("rngname").Row
activecell.Column-range("rngname").Column

Regards,
Stefi

€˛RichardGarfield€¯ ezt Ć*rta:

Help please. How do I find the offset of the active cell from the top left
cell in a named range?



All times are GMT +1. The time now is 05:17 PM.

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