PDA

View Full Version : ActiveCell.Text



supes927
07-08-2008, 01:02 AM
I'm a beginner at vba so I don't know any of the specific syntax. My task at the moment is figuring the methods that go with ActiveCell. I found that typing ActiveCell.Value = 10 shows the number 10 in the cell but when I typr ActiveCell.Text = "Hello" I get an error saying object required.
So far I only have three lines in the macro:

Sub mymsgbox()

ActiveCell.Text = "Hello"

End Sub

What constitutes an object in this situation?

Bob Phillips
07-08-2008, 01:05 AM
The text property of a range is a read-only string, it shows how the value looks not the actual value, so you cannot set that property.

marshybid
07-08-2008, 02:41 AM
Hi there,

The code below will fill in text (defined value) in your active cell


Sub mymsgbox()
ActiveCell.FormulaR1C1 = "Hello"
End Sub


Marshybid