Jan
Jan

Reputation: 101

Get the First Column in the same row

How can I find the first column same row in a Excel-sheet with vba?

I wrote a macro for finding a word in a cell an I need to get an message into the same row first column.

Best regards

Upvotes: 0

Views: 7435

Answers (3)

aCell.Offset(0, -aCell.Column + 1).Value = "This is my message."

Upvotes: 2

chris neilsen
chris neilsen

Reputation: 53135

To avoid the need to know the sheet name, use

aCell.EntireRow.Cells(1,1)

Upvotes: 1

Siddharth Rout
Siddharth Rout

Reputation: 149287

Sheets("Sheet1").Cells(aCell.Row,1)

Where aCell is the range which has the word which your searched

Alternatively, you can also use this

Sheets("Sheet1").Range("A" & aCell.Row)

Upvotes: 3

Related Questions