Reputation: 87
Sub selectRange()
Dim A As String
A = ActiveCell.Address
MsgBox A
MsgBox Cells(A)
End Sub
When I pass A as a parameter it shows error how should i pass values in parameter for current cell's data.
Upvotes: 4
Views: 25089
Reputation: 6105
The proper syntax for Cells()
is:
Cells([row number], [column number]).Value
To use the cell's address, use Range()
instead:
Range([Address Range]).Value
Range(A).Value 'in your example
Upvotes: 11