Coding Novice
Coding Novice

Reputation: 447

Need Alternative to Cells() Command to Reference Strings

Oddly enough, I am surprised that I cannot find this information online! I am trying to use the following code:

If Cells(RowCount, 215).Value = "Edge Roughness" Then
    sb.Append "ER"
End If

The cell needs to be an exact match to the text string. For example, some cells are just "Width" while some are "Width Roughness"

Can somebody explain why I cannot use the Cells(RowCount, 215) command? Key note: it has to be variable so that I can use the RowCount command.

Upvotes: 1

Views: 45

Answers (1)

MatthewD
MatthewD

Reputation: 6761

You can use range. It is for the worksheet.

Range("A" & RowCount).Value

Upvotes: 2

Related Questions