Sub ex2()
Sheets("sheet2").Range("a2").Text = "Anil"
End Sub
I want to copy the data Anil into cell a2, but I am getting RUN time error saying:
Unable to set the Text property of the Range class.
Can any one advice how to work using TEXT METHOD?
.Text
is read only.
To set cell values you use the .Value
property.
Use the .Value property and not the .Text:
Sub ex2()
Sheets("sheet2").Range("a2").Value = "Anil"
End Sub
According to the following link, you should be using the Value method...
http://msdn.microsoft.com/en-us/library/office/gg192736(v=office.14).aspx
Sub ex2()
Sheets("sheet1").Range("a2").Value = "Anil"
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With