ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Possible offset issue (https://www.excelbanter.com/excel-programming/437274-possible-offset-issue.html)

Barb Reinhardt

Possible offset issue
 
Intermittently, I'm getting the "wrong" cell chosen when I use this code

r and myaRange reference a single cell. Once recently, myR was one column
to the right of where it should have been.

Set myR = r.Offset(0, myaRange.Column - r.Column)

I had to change the code to this so that it worked.
Set myR = r.Parent.Cells(r.Row, myaRange.Column)

Has anyone ever seen this before and if so, what's going on?

Thanks,

Barb Reinhardt



All times are GMT +1. The time now is 12:29 PM.

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