This might be a very simple question with a hopefully simple reply. I have been googling for ages, and I just cannot seem to figure it out.
I need to insert some special formatted text from VBA, as the text inserted depends on 1 out of four 4 answers to a dropdown menu.
A picture of what I want to insert
As you can see on the picture, the user chose 'SM-1'. That means the below three requirements below has to be inserted in that format.
So all the balck text has to be text that is automatically inserted, and all the red text has to be inserted as FormFields that the user can write text in.
I really hope you guys can help out! Tell me if I'm not being specific enough and I will elaborate. :)
Related
Thanks in advance for your help. I've searched the web and this site and I can't seem to find the answer I'm looking for.
Ok I have an access db with a table named docs. It has two columns. One named Docs and the other email. I know how to tell VB that a value of a texBox = The value selected from the dropDown that is mapped to the first column.
What I can't seem to get the code to do is: When the value is selected from the dropDown, it will make the value of textBox2 by selecting it from the next column over.
Basically if you select say Dr. Smith the value from the next column his email, Smith#abc.org would be the value of a textBox.
I hope I fully explained what I'm trying to achieve. Please let me know if any other information is needed. Again thank you all for an help you provide.
Aaron
I have a report/letter with a query as its record source.
Some of the paragraphs I would like the user to be able to amend instead of asking each time it needs a change.
I set up a local table called LetterWording; this has one record with four short text fields which contain the wording for the paragraphs which need amending.
In the letter I added textboxes for these paragraphs with the control source pointing at the relevant field (e.g. =[LetterWording]![1stInterviewParagraph1]).
However, when I open up the letter in report view I get the Enter Parameter Value popup asking for LetterWording.
If I click OK without entering anything (I don't know what it wants anyway) the letter opens and those four paragraphs say #Error.
Can anybody please advise what I'm doing wrong here?
Thank you!
Just me being silly. As I can't/don't want to add to the original record source query I should add these paragraphs as sub-reports.
you most probably going to think "what an idiot" but remember i never done any type of coding before so this is all new to me,
My problem are that i'm working on a HUGE excel sheet with loads of data that is not needed. i need to sort the data into a few columns, i only need column "A,K,AN,AQ" but in column "AS" i only need certain values (yes,no,blank) i only want the yes and blank values. like i said never done any coding before but i know that you can use an macro to do it so please help, how do i go about this?
before trying to get into macros, try to use functions with if else statements. They are quite easy to handle. Like: If (yes) then put it into X. Later, you could select all needed. Also, check the, how the dollar sign is used
use this links to see, if it is something for you.
One quick and dirty way of getting this job done would be to:
Delete the columns you don't need.
Select all cells in the range you're interested in, click the Insert menu, and choose "Table". If your columns have titles, select the box for "My Table has Headers."
-This turns your data into an array so that Excel recognizes that each row is an entry (instead of thinking that the cells are unrelated).
Now you can use the filter icon in the column headers to select and display only the rows containing the values in column X that you're interested in.
Note that there are some limitations to what the table feature is good for, so, as always, whether this is a good solution for you depends on what you want to do with the data.
I have a program which outputs a collection of tables in a word document which I eventually want to post as an html file with bookmarks and an index. The tables are grouped by "Name:" where there is a 3 row table that contains detailed header information for a section of data, then there is a second table which can span multiple pages which contains the data for that section. There is then a page break so that the next sections header table is on a new page. This can occur for a variable number of sections numbers in the hundreds. I need to write a script that
searches my document for "Name:", which is unique and would not
appear anywhere but the header table,
grabs the text that follows "Name:" within that table cell (for example "Name: Line 1234)
replaces all the blanks in that text string with an underscore to
make it a suitable bookmark name,
creates a bookmark with the name,
goes back and creates an index at the front of the document
Saves the file as an html
I have a passing familiarity with VB for word, I have used it a bit in excel, but am by no means an expert. I would appreciate any advice on functions and objects that I should be using for this script.
Hey MikeV from what I can gather, your problem seems more conceptual, less specific. What I mean is, have you started yet? Or looking at a blank script page?
I'm relatively new to coding, so I get that myself. What I do is make a list of what I need to do (what you have). Then think of the code or psuedo-code that would go with each step. Then you can start to build your script. You don't have to start with step one (as step 2/3 is often the more interesting bit), but let's do that.
Now, you need to search for a text string containing "Name:". I am proficient with VBA in excel, but haven't done anything for word. So I'd look it up. Googling "VBA find word in word document" will bring you to this page, which shows you how to approach step one. So steal their code, alter it to fit your needs and move on to step 2. Repeat the process, and that's how you build your algorithm! :)
Just a FYI, typically StackOverflow is for specific questions with an answer that can be confirmed, whereas you asked for help building an algorithm. I'd reserve those questions for your programming professor or friend who can help.
cheers
I couldn't figure out how to word the question, so please comment if you have a better wording.
I am creating a report the has multiple sections, all displayed on one sheet. One of the sections need to be displayed at equal column widths, while the rest of the report has varying column widths. What I would like to do is display this section as some sort of chart/table that will display as if it was part of a continuous report. Should I be using listboxes or is there a better option?
Thanks for any help.
I'm not sure I completely understand your question, but from what I do understand, maybe what you could do is put the part with the fixed column widths on another part of your sheet and then:
Copy it
Go to where you want it in the report and Paste Special > Linked Picture (I)
I think that would give you what you're looking to accomplish, otherwise, please clarify a bit more...