Reputation: 101
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
Reputation: 38500
aCell.Offset(0, -aCell.Column + 1).Value = "This is my message."
Upvotes: 2
Reputation: 53135
To avoid the need to know the sheet name, use
aCell.EntireRow.Cells(1,1)
Upvotes: 1
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