Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
we have some written text in column, we want to add a macro that will add
some other text to that column, how we can do this ??? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You don't mention the source of text to add. If it's a constant string, this
macro adds it to cells in column A: Sub addtext() Dim Acell As Range Addedtext = "texttoadd" NoOfUsedCells = Range("A" & Rows.Count).End(xlUp).Row For Each Acell In Range("A1:A" & NoOfUsedCells) Acell.Value = Acell.Value & Addedtext Next Acell End Sub Regards, Stefi €˛rich_jonathan€¯ ezt Ć*rta: we have some written text in column, we want to add a macro that will add some other text to that column, how we can do this ??? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub Add_Text()
Dim cell As Range Dim moretext As String Dim thisrng As Range On Error GoTo endit whichside = InputBox("Left = 1 or Right =2") Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _ .SpecialCells(xlCellTypeConstants, xlTextValues) moretext = InputBox("Enter your Text") If whichside = 1 Then For Each cell In thisrng cell.Value = moretext & cell.Value Next Else For Each cell In thisrng cell.Value = cell.Value & moretext Next End If Exit Sub endit: MsgBox "only formulas in range" End Sub Gord Dibben MS Excel MVP On Thu, 20 Mar 2008 23:46:00 -0700, rich_jonathan wrote: we have some written text in column, we want to add a macro that will add some other text to that column, how we can do this ??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a macro or function to convert values to it written text | Excel Worksheet Functions | |||
Create .NET object written in C# in Excel Macro | Excel Discussion (Misc queries) | |||
Create .NET components written in C# inside Excel Macro | Excel Discussion (Misc queries) | |||
I have never written a macro | Excel Discussion (Misc queries) | |||
I have never written a macro | Excel Discussion (Misc queries) |