Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JJ JJ is offline
external usenet poster
 
Posts: 122
Default How do I create a string from a range (Excel VBA)?

I want to create a userform that can string a selected range of cells to a
textbox. I can do it on predifend cells, but I want it to be flexible so
that you can highlight the cells and then click a button that will string it.
Can anybody help me with a link to a page that explain how to string from
highlighted cells?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default How do I create a string from a range (Excel VBA)?

Dim rng As Range
Dim cell As Range
Dim str

Set rng = Application.InputBox("Use mo=use to select cells", Type:=8)
For Each cell In rng
str = str & cell.Value & " "
Next cell
TextBox1.Text = str


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"JJ" wrote in message
...
I want to create a userform that can string a selected range of cells to a
textbox. I can do it on predifend cells, but I want it to be flexible so
that you can highlight the cells and then click a button that will string
it.
Can anybody help me with a link to a page that explain how to string from
highlighted cells?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create comma-delimited string from dynamic range? Ptyrider Excel Discussion (Misc queries) 2 November 26th 07 09:04 AM
making a text string recognizable as a name range in excel cheloco Excel Programming 1 January 27th 07 12:15 AM
Excel / Formatting a Cell / Setting a string range [email protected] Excel Programming 1 October 24th 06 05:53 AM
Passing a String in Array to Range as String [email protected] Excel Programming 2 September 1st 04 01:13 AM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"