Trailing character when copying excell cell into word textbox - Help?

yodandy

n00b
Joined
Jan 13, 2006
Messages
35
Heres the run down.

I have two things open, a Microsoft Excel spreadsheet, and a Microsoft Word document

When I copy a twelve digit number by right clicking the cell, hitting copy, then pasting it into a textbox on a word document, I get a trailing symbol. Here is a picture with the cell, and the result when pasted.

4u4vnv7.jpg


Why is this? Is there a macro I can run to fix it? Or a setting somewhere to fix it?

If im being too vague let me know, thanks for the help!
 
You probably meant to post this in the "general software" area, as it's got nothing to do with programming.

To me, it looks like Word is set to show paragraph marks. This is a setting you can turn off or on in Word. Exactly how you do it depends on which version of Word you're usin'.
 
Well, i posted it here, because there may be a VBA solution...

Its not going into word just anywhere, as you can see above, its going into a textbox control

Only time it shows up is when pasting it into that textbox
 
What I did was print screen the two programs

on the left of that pic is what im right clicking, and copying in excel

then im pasting it into a word document's textbox

and every time i post it into that textbox, or any other one, i get a paragraph character

(Anything elsewhere in the word document is fine, such as like, if i pasted next to where it says "Survey, all im getting the character showing up in is when I try to paste into textboxes)
 
What I did was print screen the two programs

on the left of that pic is what im right clicking, and copying in excel

then im pasting it into a word document's textbox

and every time i post it into that textbox, or any other one, i get a paragraph character

(Anything elsewhere in the word document is fine, such as like, if i pasted next to where it says "Survey, all im getting the character showing up in is when I try to paste into textboxes)
select the text in that box and turn off "Show formatting characters" (search in word help)
 
Alright, to better illustrate the problem, since the pic is a bit confusing, and I guess im not being too specific, try doing this, youll see what I mean.

Open a blank excel document, in the first cell, type the number 1 in a cell, right click the cell, hit copy

Open a blank word document, go to view, toolbars, control toolbars (if its not already open), add a text box, exit design mode, and click the newly added textbox (not just anywhere on the document, click the textbox), and hit ctrl+v.

This is the result...
66jxr1v.jpg
 
Before, you said the only time it shows up is when pasting into that specific textbox. Now, you're saying that it happens when you paste directly into a new document in Word.

If it's happening when you paste into a new document, then there's really no problem. You have Word set to show paragraph marks, as I noted in the second post in the thread.
 
Before, you said the only time it shows up is when pasting into that specific textbox. Now, you're saying that it happens when you paste directly into a new document in Word.

If it's happening when you paste into a new document, then there's really no problem. You have Word set to show paragraph marks, as I noted in the second post in the thread.

I never said it happens when i paste directly into a new document, i said that when pasted into a TEXTBOX in word is when im getting the paragraph mark, believe me the first thing I checked when this popped up was to see if paragraph marks were set to be shown. If you actually try what I said in my previous post, youll see the problem im running into.

anyway, thanks for all your help guys, and for the effort, much appreciated!

"Skip" from tek-tips.com figured me out a code for the problem :)

Code:
Private Sub TextBox1_Change()
    Text = ""
    For i = 1 To Len(TextBox1.Text)
        character = Right(Left(TextBox1.Text, i), 1)
        Select Case character
          Case "0" to "9"
            Text = Text & character
        End select
    Next i
    TextBox1.Text = Text
End Sub
 
Alright, to better illustrate the problem, since the pic is a bit confusing, and I guess im not being too specific, try doing this, youll see what I mean.

Open a blank excel document, in the first cell, type the number 1 in a cell, right click the cell, hit copy

Open a blank word document, go to view, toolbars, control toolbars (if its not already open), add a text box, exit design mode, and click the newly added textbox (not just anywhere on the document, click the textbox), and hit ctrl+v.

This is the result...
66jxr1v.jpg

I just went through what you posted here, and got the same paragraph mark. Then I tried what I suggested in my previous post, and voila! no paragraph mark.
 
If you actually try what I said in my previous post, youll see the problem im running into.
I can't follow your instructions exactly because they don't match the version of Office I'm using. I'm Using Word for Windows 2007 and Excel 2007, and I don't get a paragraph mark when I paste a cell from Excel into a plain-text edit control in a Word for Windows form. You must be using a different version of Office. I could go find a computer that has that same version, but I don't know which version it is that you're using.

Regardless, I'm glad you've got it sorted out.
 
I just went through what you posted here, and got the same paragraph mark. Then I tried what I suggested in my previous post, and voila! no paragraph mark.

Correct, that does work, but the users who will be using this wont be doing that, they will be clicking the cell each time, which is why i was asking about removing the paragraph mark when doing so.

I can't follow your instructions exactly because they don't match the version of Office I'm using. I'm Using Word for Windows 2007 and Excel 2007, and I don't get a paragraph mark when I paste a cell from Excel into a plain-text edit control in a Word for Windows form. You must be using a different version of Office. I could go find a computer that has that same version, but I don't know which version it is that you're using.

Regardless, I'm glad you've got it sorted out.

Ahh, gotcha, I should have specified, yes, im running 2003...thanks for the help everyone!
 
Back
Top