Referencing Cells

  • Thread starter Thread starter Sok Hong
  • Start date Start date
S

Sok Hong

This is my first time programming in VBA and I seem to
have some difficulty in referencing cells.

In the code I am writing I need to set a cell as a base
point, I know of the row for the base point but not the
column. After base cell is established, I would need to
reference other cells in reference to the base point cell
(Column for the base point may change in each iteration).

Here's the code I've tried using, but the third line gives
me an error.

Range("B30").End(xlToRight).Select
ActiveCell.Offset(rowOffset:=0, columnOffset:=-1).Select
Range(Cells("31", ActiveCell.Column)).Select

Can someone help me with this? Thank you.
 
From the 3rd line of your codes, it seems to me that you only need:-

Cells(31, ActiveCell.Column).Select

If you want to select a cell, you don't necessarily need a range object. A
cell object will do the job.
 
Back
Top