Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default How do I Paste thie answer into specific cell using vb...tia sal

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I Paste thie answer into specific cell using vb...tia sal

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

--
Regards,
Tom Ogilvy


wrote in message
. ..
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get a macro to populate the answer into one specific cel Matt Excel Discussion (Misc queries) 3 March 17th 09 08:49 PM
Not allowing to continu unless a specific cell has specific answer madubois9 Excel Discussion (Misc queries) 3 October 25th 07 12:45 AM
Paste Specific Cell to Selected Cell W.Easton Excel Worksheet Functions 6 January 12th 07 08:02 PM
A Macro that will cut and paste to specific cell VBA12thRoundDraftPick Excel Discussion (Misc queries) 1 March 31st 05 06:11 AM
Macro to Paste to specific line, and continue to Paste each time on next row not over tomkarakowski[_2_] Excel Programming 1 May 28th 04 06:50 PM


All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"