Thanks so much.
Now I'm getting an "Object Required" error on this line of code:
lb.AddItem.txt
I have a Listbox call Listbox1 on the sheet so I'm not sure what's causing this error.
Also, do you know how to return multiple codes and descriptions in the listbox?
Thanks!!
I need some help with a keyword search function. I have a button that when the user hits it, an InputBox appears asking for their keyword they would like to search. I need the results displayed in Listbox1.
I'm having 2 problems right now.
1. The code below is returning an error that says...
I did that but I must have some other setting that is messing it up because the result looks like this:
D
i
f
f
e
r
etc...
It keeps setting the width to 18.75 and growing the height as large as it needs to for the amount of data.
Ok. I got the NewLine to work now by changing vbNewLine to vbCr. Also, I resolved the String Too Long problem by doing this:
If temp = "" Then
ActiveDocument.Bookmarks("Text1").Range.Fields(1).Result.Text = ComboBox1.Value
Else
ActiveDocument.Bookmarks("Text1").Range.Fields(1).Result.Text...
I have one more question to go along with this...
The text the users to select seems to be too long to fit inside a Text Form Field as I'm getting "String too long" error.
So how can I print/display my results to just a Text Box (that I find under the Insert menu)? It looks like I can fit...
I have a line of code that displays the selections the user makes in a combobox to a textbox. It separates each selection with a comma.
Here's the code:
ActiveDocument.FormFields("Text1").Result = temp & ", " & ComboBox1.Value
The result will display as:
I would like to have a new line...
OK. That's definitely going in the right direction! I feel like it's really close. However, I am obviously doing something wrong in my loop.
1. When I open the .doc file it has my rows 1:45 pasted at the end of the document instead of the beginning. Then my second set of 45 rows pasted as...
One more thing...I kept saying 45 "rows" but I really need Columns A:F for 45 rows.
Example:
A1:F45 (if they are all visible)
A46:F91 (if they are all visible)
etc
I hope I didn't further complicate what I was trying to get across.
I'm hoping you guys can help me with a simple loop problem. I have some VB code that takes a particular range of cells and copies and pastes them into a Word doc as a picture. The users have the ability to show and hide rows as needed in the worksheet. I need to just pick up the first 45...
Right now I have code that selects a particular range of cells and it copys and pastes those cells in a Word doc. Then it goes onto my next range of cells and does the same thing and so on.
The problem is that because users need to hide various rows, the length of the page changes.
I need to...
I have my problem resolved from the help of another forum on this site. Here's my code for anyone else who may find it helpful. It's cool. It takes one worksheet in a workbook and pastes it into a Word Doc. Then attaches that Word Doc to an email.
Private Sub CommandButton1_Click()
Sub...
Thanks for all your help!!! I ended up just pasting my last cells first, and my first cells last. So everything is good now! Here's my code for anyone else who may find it helpful. It's cool. It takes one worksheet in a workbook and pastes it into a Word Doc. Then attaches that Word Doc to...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.