Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add text to existing text string
Using Excel 2000. In a VBA macro, I want to copy the contents of a
cell containing text and add that data to the end of a text string in the activeCell without overwriting the existing data, then move down 1 row and repeat until a blank cell is found. I have tried using copy then enter edit mode, but paste is not available in edit mode. Is there a bit of code that I can use to accomplish this? Would very much appreciate your input. William |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add text to existing text string
If the text to be added to the end of the active cell and non empty cells
below is in "A1" then this would do what you're asking. Sub EditByConcatenation() Dim rngEdit As Range Set rngEdit = ActiveCell Do Until rngEdit.Value = "" rngEdit.Value = rngEdit.Value & Range("A1").Value Set rngEdit = rngEdit.Offset(1, 0) Loop End Sub Steve Yandl "William" wrote in message ups.com... Using Excel 2000. In a VBA macro, I want to copy the contents of a cell containing text and add that data to the end of a text string in the activeCell without overwriting the existing data, then move down 1 row and repeat until a blank cell is found. I have tried using copy then enter edit mode, but paste is not available in edit mode. Is there a bit of code that I can use to accomplish this? Would very much appreciate your input. William |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add text to existing text string
Or a refinement that allows selecting the start cell for the fill.
Sub Add_Copied_Text() Dim cell As Range Dim moretext As String Dim thirngEdit As Range Dim rngEdit As Range 'select a cell with text to copy Set currentSelection = Application.ActiveCell currentSelection.Name = "oldrange" moretext = Range("oldrange").Value 'select a cell to start the fill Set rngEdit = Application.InputBox(prompt:= _ "Select a cell", Type:=8) Do Until rngEdit.Value = "" rngEdit.Value = rngEdit.Value & Range("oldrange").Value Set rngEdit = rngEdit.Offset(1, 0) Loop End Sub Gord Dibben MS Excel MVP On Sun, 11 Feb 2007 16:26:03 -0800, "Steve Yandl" wrote: If the text to be added to the end of the active cell and non empty cells below is in "A1" then this would do what you're asking. Sub EditByConcatenation() Dim rngEdit As Range Set rngEdit = ActiveCell Do Until rngEdit.Value = "" rngEdit.Value = rngEdit.Value & Range("A1").Value Set rngEdit = rngEdit.Offset(1, 0) Loop End Sub Steve Yandl "William" wrote in message oups.com... Using Excel 2000. In a VBA macro, I want to copy the contents of a cell containing text and add that data to the end of a text string in the activeCell without overwriting the existing data, then move down 1 row and repeat until a blank cell is found. I have tried using copy then enter edit mode, but paste is not available in edit mode. Is there a bit of code that I can use to accomplish this? Would very much appreciate your input. William |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I add text to existing text in a whole column in Excel? | Excel Discussion (Misc queries) | |||
How do I merge new text into existing text cells. | Excel Discussion (Misc queries) | |||
replacing text in all cells with existing text plus something | Excel Discussion (Misc queries) | |||
How to input additional text to multiple of existing cells that has text | Excel Worksheet Functions | |||
want to remove all text characters equal to one character in length from text string | Excel Worksheet Functions |