#1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Categories

Hello all:

I am making a userform with a text box and a RefEdit button. The user enters
text in the textbox, and then selects a range with the RefeEdit. Now I need
to apply the word from the text box in each cell from the range. However I
need the current text in the range should stay, just the text from the text
box should be "Added" before the original text.

Please help me figure this out.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Categories

untested -- but might work


For Each c In 'the range you want to use
c.Formula = textbox1.text & c.value
End If
Next



"art" wrote:

Hello all:

I am making a userform with a text box and a RefEdit button. The user enters
text in the textbox, and then selects a range with the RefeEdit. Now I need
to apply the word from the text box in each cell from the range. However I
need the current text in the range should stay, just the text from the text
box should be "Added" before the original text.

Please help me figure this out.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Categories

Something is wrong. First the error was end with out if. So I took it out.
The the error was on the first line: For Each c In Categories.RefEdit1.Value.
Please help me finish this.

Thanks for your help.



"dmoney" wrote:

untested -- but might work


For Each c In 'the range you want to use
c.Formula = textbox1.text & c.value
End If
Next



"art" wrote:

Hello all:

I am making a userform with a text box and a RefEdit button. The user enters
text in the textbox, and then selects a range with the RefeEdit. Now I need
to apply the word from the text box in each cell from the range. However I
need the current text in the range should stay, just the text from the text
box should be "Added" before the original text.

Please help me figure this out.

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 199
Default Categories

I don't know what your Categories in Categories.RefEdit1.Value means. Is
that your object name of your Userform?
Anyway, add the commandbutton in your userform and try the code below.
first, input data in both textbox and refedit, then click the commandbutton.

Private Sub CommandButton1_Click()
Dim rng As Range
For Each rng In Range(Me.RefEdit1.Value)
rng.Value = Me.TextBox1.Value & rng.Value
Next
End Sub

keiji

art wrote:
Something is wrong. First the error was end with out if. So I took it out.
The the error was on the first line: For Each c In Categories.RefEdit1.Value.
Please help me finish this.

Thanks for your help.



"dmoney" wrote:

untested -- but might work


For Each c In 'the range you want to use
c.Formula = textbox1.text & c.value
End If
Next



"art" wrote:

Hello all:

I am making a userform with a text box and a RefEdit button. The user enters
text in the textbox, and then selects a range with the RefeEdit. Now I need
to apply the word from the text box in each cell from the range. However I
need the current text in the range should stay, just the text from the text
box should be "Added" before the original text.

Please help me figure this out.

Thanks.

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
Counting using 2 categories Nick Horn Excel Discussion (Misc queries) 2 May 1st 08 09:38 PM
Categories Stonewall Excel Programming 0 June 5th 07 08:54 PM
Top Five in Categories Joe D Excel Discussion (Misc queries) 2 November 25th 05 05:17 PM
2 categories Joe Resler Excel Discussion (Misc queries) 4 November 2nd 05 08:37 PM
sum over categories mikebo Excel Discussion (Misc queries) 2 January 21st 05 05:11 PM


All times are GMT +1. The time now is 11:01 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"