|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
excel text
Using Office 2000. I would like to take data in a1, combine it with data in b1, and place it back in a1. ie a1 contains "Tom" b1 contains "jones" I would like to combine them so that a1 becomes "Tom Jones"
I tried copying them to other columns then concatenating them to a1, but when I deleted the "extra" columns which I had originally moved them to, I also deleted the concatenate formula and all the text disappeared from a1. Any help greatly appreciated. wolferd |
|
#2
|
|||
|
|||
|
Hello wolferd1,
Paste the code below into your excel macro. Remember to change the workbook and worksheet to the suitable name for your case Code:
Sub Macro1()
Dim MySheet As Worksheet
Dim RowNumber As Integer
Const ColumnA = 1
Const ColumnB = 2
Set MySheet = Workbooks("Book1.xls").Worksheets("Sheet1")
With MySheet
RowNumber = 1
While Not IsEmpty(.Cells(RowNumber, ColumnA))
.Cells(RowNumber, ColumnA) = .Cells(RowNumber, ColumnA) & " " & .Cells(RowNumber, ColumnB)
RowNumber = RowNumber + 1
Wend
End With
End Sub
|
|
#3
|
|||
|
|||
|
JamesLe
That is great and does exactly what I needed. I have not had occasion to use macros before. I see a new way to learning and doing things. Is there an online site or a suggested book for learning this? Thanks wolferd Quote:
|
|
#4
|
|||
|
|||
|
Hello wolferd1,
I don't have any particular books to suggest but you may do google search for Excel VBA or Excel Programming books |
![]() |
| Viewing: ASP Free Forums > Other > ASP Free Lounge > excel text |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|