Help with entering text in a macro.

G

Guest

As part of an existing macro I want to add quite a lot of text in rows 1 to 13.

The way I am achieving this is using:-

ActiveSheet.Cells(1, 1).Value = "insert text here to appear in row 1 column
1, the value of cell A15 isâ€

ActiveSheet.Cells(2, 1).Value = "insert text here to appear in row 2 column
1â€

As part of the above I want to display the content of cell A15 at the end of
the text in row 1 column 1. I have written the following:-

ActiveSheet.Cells(1, 1).Value = "insert text here to appear in row 1 column
1, the value of cell A15 is†&A15.

The problem I have is that the text is inserted in row 1 column 1, but the
contents of A15 are not displayed. Can someone please advise why the contents
of A15 are not displayed?

Additionally, is there a better way than above to populate cells with text
as part of a macro?
 
G

Guest

Duke,

Coded the line as :-


ActiveSheet.Cells(1, 1).Value = "insert text here to appear in row 1 column
1, the value of cell A15 is†Range("A15").value

and I get a Compile Error saying Expected : End of statement with the word
Range highlighted.
Also tried a dot (.) in front of the Range, and I get the same result.

Any ideas how I can code it?
 
G

Guest

try an ampersand before the Range("A15").value

ActiveSheet.Cells(1, 1).Value = "insert text here to appear in row 1 column
1, the value of cell A15 is " & Range("A15").Value
 

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