![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 97
|
I want to concatenate several cell separated by the "|" symbol, I know that in excel this would be: a4=a1&"|"&a2&"|"&a3
How can I do this in VBA?????? Hugo |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,374
|
Quote:
Code:
Sub MySub()
Dim MyString as String
MyString = Range("A4") & "|" & Range("A5")
' ...etc.
' Then if you want to put in a cell:
Range("A1") = MyString
' or, combine the 2:
Range("A1") = Range("A4") & "|" & Range("A5")
End Sub
Russell [ This Message was edited by: Russell Hauf on 2002-02-22 17:16 ] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|