Populating cells with text using VBA
<p>I want to select a value from one sheet and put it in a cell on a different sheet.</p>

<p>My script determines the proper value but I cannot get the value into the sheet.</p>

<p>This function returns the !Value error on the 6th line of the following excerpt:</p>

<pre><code>Function PrintTest(Cell)
Dim iRow As Integer
Dim bs As Worksheet
Set bs = ThisWorkbook.Sheets("By System")
iRow = Cell.Row
bs.Cells(iRow, 6).Value = "Hello World"
End Function
</code></pre>

<p>I also tried using <code>.Text</code>.</p>

<p>Note: In the actual Script the text will be seeded from the other sheet and I have it stored in a variable. I am not looking for a way to get the same text into many different cells.</p>

<p>Update: <code>Cell</code> is passed from an Excel spreadsheet as an empty cell G4. <code>Row</code> is defined as 4. To call the functions I have been typing "=PrintTest(G4)" in my Excel worksheet named "By System" .</p>

<p>Update 2: Scott Holtzman answered the question in a comment. You cannot write to cells from a UDF called from within a cell. The fix was to call it from a button.</p>