Referring to a cell without using Offset

  • Thread starter Thread starter Ayo
  • Start date Start date
A

Ayo

Is there another way to refer to a cell that is in the same row and Column A
of the active cell. For example, let say Range("D8") is my activecell and I
want to refer to Range("A8"), how do I do that without using c.Offset(0,-3).

Thanks
Ayo
 
Do you mean the first column of the row. If then

Cells(activecell.Row,1)

OR
Cells(activecell.Row,"A")

Or
Range("A" & Activecell.row)


If this post helps click Yes
 
I am sorry but I forgot to add a very important part, I am using a For...
Each... Next statement. My goal is: for very cell in Range("D2:D5") say, I
want to assign the values in column A, B and C of the same row to different
cells in another worksheet, for eaxmple using the following snippet of code:

For Each rc In marketWS.Range(hdrColumn & "5:" & hdrColumn &
marketWSlastRow).Cells
If rc.Interior.ColorIndex = 3 Then
pastdueWS.Range("A" & pastdueWS_currRow) = rc.Offset(0,
marName)
pastdueWS.Range("B" & pastdueWS_currRow) = rc.Offset(0, NLP)
pastdueWS.Range("C" & pastdueWS_currRow) = rc.Offset(0, -1)
pastdueWS.Range("D" & pastdueWS_currRow) = rc.Offset(0,
candID)
pastdueWS.Range("E" & pastdueWS_currRow) = milestoneTitle
pastdueWS.Range("G" & pastdueWS_currRow) = "p"
pastdueWS_currRow = pastdueWS_currRow + 1
End If
Next rc

I want to replace the rc.Offset with something more general.
 
rc.parent.cell(rc.row, "A").value

gives you the value of Column A for the row that RC is on...
 
rc.parent.cell(rc.row, "A").value
gives you the value of Column A for the row that RC is on...

Another way to return these same value...

rc.EntireRow.Cells(1).Value
 
Back
Top