Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Code to cut and paste text from continuous cells to make a document such as a memo or narrative

Frequently I have text in various cells in Excel. For instance, A1,
A2, A3 might have text only in these cell. There might be a different
sentence in each cell. I would like to cut the text from A2 and A3 in
that order and append it to the text in A1 without doing cuts and
pastes. The cells would always be contiguous as in my example.
Better yet, if there was a wizard that let me name the cells from
which I want to take text out of and the cell that I want to paste
text into, that would be best.

Thank you.

Steve G

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Code to cut and paste text from continuous cells to make a documen

Is something like this whatt you are looking for?

Sub cutandpaste()

OldCell = InputBox("Enter Cell to copy")
NewCell = InputBox("Enter Cell to Paste")

Range(NewCell).Value = Range(NewCell).Value & Range(OldCell).Value

End Sub


"Steve G" wrote:

Frequently I have text in various cells in Excel. For instance, A1,
A2, A3 might have text only in these cell. There might be a different
sentence in each cell. I would like to cut the text from A2 and A3 in
that order and append it to the text in A1 without doing cuts and
pastes. The cells would always be contiguous as in my example.
Better yet, if there was a wizard that let me name the cells from
which I want to take text out of and the cell that I want to paste
text into, that would be best.

Thank you.

Steve G


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Code to cut and paste text from continuous cells to make a document such as a memo or narrative

On Aug 23, 12:35 pm, Steve G <emailfromandtome-
wrote:
Frequently I have text in various cells in Excel. For instance, A1,
A2, A3 might have text only in these cell. There might be a different
sentence in each cell. I would like to cut the text from A2 and A3 in
that order and append it to the text in A1 without doing cuts and
pastes. The cells would always be contiguous as in my example.
Better yet, if there was a wizard that let me name the cells from
which I want to take text out of and the cell that I want to paste
text into, that would be best.

Thank you.

Steve G


If you select the cells in the order you want them, then this should
work. It will prompt you for the destination cell.

Sub test()
Dim rng As Range, rngPaste As Range

Set rng = Selection
Text = ""
For Each c In rng
Text = Text & c.Value
Next
Set rngPaste = Application.InputBox _
(Prompt:="Please select the destination cell", Type:=8)

If Not rngPaste Is Nothing Then
rngPaste.Value = Text
End If

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Code to cut and paste text from continuous cells to make a document such as a memo or narrative

Ferris--

Does it work like this:

I put the macro in my personal.xls. I open the file with the text.
Do I highlight/select the cells I want to transfer the text from?
Then I run the macro. The macro asks me for input. I type in C5 or
D7 or whatever cell I want the text to go into. I hit "enter."

Thank you for your assistance.

Steve G

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Code to cut and paste text from continuous cells to make a document such as a memo or narrative

On Aug 23, 5:58 pm, Steve G
wrote:
Ferris--

Does it work like this:

I put the macro in my personal.xls. I open the file with the text.
Do I highlight/select the cells I want to transfer the text from?
Then I run the macro. The macro asks me for input. I type in C5 or
D7 or whatever cell I want the text to go into. I hit "enter."

Thank you for your assistance.

Steve G


Yeah, it should work pretty much like that. If you have Excel 2003 or
earlier I'd throw a button on the toolbar to make it accessible. You
don't have to type in the cell reference, you should be able to click
anywhere on the sheet and the cell reference should appear in the
input box.



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
make continuous list of days of week without Sunday pb.admin Excel Discussion (Misc queries) 1 October 9th 09 04:04 PM
how do i make a continuous data table gazman Excel Discussion (Misc queries) 0 May 28th 08 02:48 AM
Appropriate Object To Hold Memo-Sized Text? PeteCresswell[_2_] Excel Programming 3 July 23rd 07 07:22 PM
Add to a string to make it continuous Adam Excel Programming 11 April 24th 05 02:06 PM
Narrative in cells Jane Excel Discussion (Misc queries) 1 January 23rd 05 04:45 PM


All times are GMT +1. The time now is 05:28 PM.

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

About Us

"It's about Microsoft Excel"