Categories

  • Thread starter Thread starter art
  • Start date Start date
A

art

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.
 
untested -- but might work


For Each c In 'the range you want to use
c.Formula = textbox1.text & c.value
End If
Next
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top