How do I Paste thie answer into specific cell using vb...tia sal

G

Guest

Greetings All,

I would like to paste the answer that is produced by this code into cell "B1" does anyone
know the proper syntax.

Sub col_to_cel()
Dim str As String
Dim c As Range, rn As Range

Set rn = Selection
str = ""
For Each c In rn.Cells
str = str & "" & c.Value
Next
str = Right(str, Len(str))
rn.Offset(1, 0).Cells(rn.Rows.Count, 1).Value = str

End Sub

TIA
SAL
 
T

Tom Ogilvy

guess someone gave you this code and you want to modify it? If so:

Sub col_to_cel()
Dim str As String
Dim c As Range, rn As Range

Set rn = Selection
str = ""
For Each c In rn.Cells
str = str & "" & c.Value
Next
str = Right(str, Len(str))
'rn.Offset(1, 0).Cells(rn.Rows.Count, 1).Value = str
Range("B1").Value = str
End Sub
 

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