Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text Functions
Can I have text from cells in one coloumn automatically added to the
beginning of anything that is typed in the same row of another coloumn? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text Functions
You could use a formula and helper column
A1 contains "this is" In C1 enter this formula =A1 & " " B1 Note: the " " adds a space. In B1 type "combined text" C1 will return "this is combined text" To have it happen without a formula you would need VBA event code. Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo endit If Target.Column = 2 Then Application.EnableEvents = False With Target .Value = .Offset(0, -1).Value & " " & .Value End With End If endit: Application.EnableEvents = True End Sub When you type text in column B then hit enter, that text will be prefaced by the text in Column A This is sheet event code. Right-click on the sheet tab and "View Code" Copy/paste into that sheet module. Alt + q to go back to Excel window. Gord Dibben MS Excel MVP On Sat, 2 Feb 2008 18:04:01 -0800, wilson o wrote: Can I have text from cells in one coloumn automatically added to the beginning of anything that is typed in the same row of another coloumn? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Text Functions
Thank you.
"Gord Dibben" wrote: You could use a formula and helper column A1 contains "this is" In C1 enter this formula =A1 & " " B1 Note: the " " adds a space. In B1 type "combined text" C1 will return "this is combined text" To have it happen without a formula you would need VBA event code. Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo endit If Target.Column = 2 Then Application.EnableEvents = False With Target .Value = .Offset(0, -1).Value & " " & .Value End With End If endit: Application.EnableEvents = True End Sub When you type text in column B then hit enter, that text will be prefaced by the text in Column A This is sheet event code. Right-click on the sheet tab and "View Code" Copy/paste into that sheet module. Alt + q to go back to Excel window. Gord Dibben MS Excel MVP On Sat, 2 Feb 2008 18:04:01 -0800, wilson o wrote: Can I have text from cells in one coloumn automatically added to the beginning of anything that is typed in the same row of another coloumn? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fun with text functions - search for text | Excel Worksheet Functions | |||
Formatting text within functions | Excel Worksheet Functions | |||
wanted help about text functions | Excel Worksheet Functions | |||
#N/A is not text, cannot use it in functions | Excel Worksheet Functions | |||
Text Functions, | Excel Worksheet Functions |