ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Forms (https://www.excelbanter.com/excel-programming/290498-vba-forms.html)

sjenks183[_2_]

VBA Forms
 
I am a beginner/self-teaching VBA user and I would like to know what
"ActiveCell.Offset(0, 1)" code stands for...especially the 0 and the 1.
I believe it has to do with the columns but I am not sure.

Thanks.


---
Message posted from http://www.ExcelForum.com/


Bob Phillips[_6_]

VBA Forms
 
As you rightly surmise, the 0 and 1 refer to then number of rows and columns
offset from the range being referred to. So in this case, it refers to the
cell that is 0 rows down (negative for up), and 1 column to the right
(negative for left) of the activecell. It doesn't have to be ACtivecell,
this is just as valid

Range("A1").Offset(0, 1)

although this is always A1, whereas Activecell could be any cell.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"sjenks183 " wrote in message
...
I am a beginner/self-teaching VBA user and I would like to know what
"ActiveCell.Offset(0, 1)" code stands for...especially the 0 and the 1.
I believe it has to do with the columns but I am not sure.

Thanks.


---
Message posted from http://www.ExcelForum.com/





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

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