Writing to a Cell in another worksheet

G

Guest

I am trying to write to a cell in another sheet in the same workbook using
the following code:
strRow = "A" + CStr(nTempRow)
With Worksheets("Temp")
strTemp = "A" + CStr(nRow)
.Range(strRow).Value = strTemp
strTemp = "B" + CStr(nTempRow)
.Range(strRow).Value = 0
End With
When the code gets to fourth row, it bums out (skips to last function in
module).

The worksheet("Temp") is physically located as the first worksheet in the
workbook. I have also used its number ("Sheet10"), but the same thing happens.
The above With is within another With (have also tried this using
Worksheet("Temp").Range(strRow).Value = ...
In the Temp worksheet, Column A is formatted as General, Row B as integer.

Thanks,
John H W
 
R

Rick B

You might want to post to an Excel newsgroup. This is a Microsoft Access
newsgroup.

Rick B
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top