![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: May 2002
Posts: 6
|
Hi all!
Can someone help me get the value of a named range (4 cells) in to a string variable. thanks. GeeVeeGee |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Do you want the cell values to be an array of strings or just one big string?
|
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Posts: 6
|
One big string
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try the following code:
Sub StringRange() Dim MyString As String Dim cell As Range For Each cell In Range("MyRange") MyString = MyString & cell.Value Next MsgBox MyString End Sub Change MyRange to the name of your range.
__________________
Kind regards, Al Chara |
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Posts: 6
|
OK thanks Al
I will give it a try GvG |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|