I am completly new to VBA WORD and I need your help to finalize a project that would help me in my work.
Sorry in advance for my English which is really not perfect....
My project is to complete a WORD document using my VBA form.
I created my form using several Youtube videos and I am currently able to fill in the bookmarks that I have placed.
Now I have a table with 3 columns and 80 rows.
You can see it in my picture what my table looks like.
In my form I have some checkboxes which must correspond to the rows of my table.
By default in my WORD document the table is whole. But I want to reduce it and keep only the checked rows in the form.
For example, if I check C3 and C5, I want the table to contain only lines C3 and C5 at the end, so 5 lines in total.
I don't know how to achieve such a result.
Can you help me pls ?
Big Thanks in advance
Kind regards
Related
Good day,
I have this index/match formula constructed based on a csv table i donwloaded from our office system and it's working fine:
IFERROR(INDEX('2nd'!$A$1:$D$100,MATCH("Enter BIN 1 Quantity",'2nd'!$B$1:$B$100,0),4),0)
However, I noticed that some tables i donwloaded showed different search patterns . Sometimes it's
"Enter Bin1 Qty"(no space) and there are times its just "Bin 1 Qty" or Bin1 Quantity". How can I make my formula adapt to this varying search criteria?. Your kind help will be much appreciated.
Thanks a lot in advance.
Mike
On this Final Table i will be displaying all the data from index matches formula. Got 2 other sheets, 1st and 2nd where I will paste the downloaded csv tables. 2nd sheet displays the 1st table image i posted here (w/c include the varying description and its equivalent value).
Hi #OverflowStacker, I tried your solution below but its throwing number error. Based on the above tables, here is the formula based on your solution, kindly check any problem in referencing, thanks, appreciate the help in advance (i entered it as an array as you mentioned below)
INDEX('2nd'!$D$2:$D$100,SMALL(IF(ISNUMBER(SEARCH(INDEX($T$2:$T$5,SMALL(IF(ISNUMBER(SEARCH($T$2:$T$5,SUBSTITUTE('2nd'!B2," ",""))),ROW($T$2:$T$5)),1)),SUBSTITUTE('2nd'!$B$2:$B$100," ",""))),ROW('2nd'!$B$2:$B$100)),1))
This is where i placed the possible search strings.
This is rather complicated :). It's an Array-formula CTRLSHIFTENTER
=INDEX($G$1:$G$4,SMALL(IF(ISNUMBER(SEARCH(INDEX($D$1:$D$4,SMALL(IF(ISNUMBER(SEARCH($D$1:$D$4,SUBSTITUTE(A1," ",""))),ROW($D$1:$D$4)),1)),SUBSTITUTE($F$1:$F$4," ",""))),ROW($F$1:$F$4)),1))
You can create a list with search terms (here in column D) to get right keyword which is searched for in table 2 (columns F:G).
Please refer to the image attachment below. I want to ask for help regarding the semi-automation of the values D2:D6. Currently, they have the following formula:
=IF(C2="n/a",$D$12,IF(C2="","",IF(OR(TODAY()=C2,TODAY()>C2),$D$11,$D$10)))
Column C on the other hand has the following formula:
=IF(B2="n/a","N/A",IF(B2="","",$B$8-$B2))
Basically, what these formulas do is that after I input a value 'x' at column B, column C automatically indicates the date 'x' days before the start date on B8. Column D then indicates whether the deadline is due, not due, not applicable, or ready (D2:D6 is data validated with a list including D9:D13).
However, if a certain action is already completed, the "Ready" option is manually selected from the drop down list, which then erases the formula. What I wish to ask for help with is how do I return the erased formula in case the "Ready" option is just accidentally selected, or if my (not excel-capable) peers will need to reuse the form by just deleting items in column A and B.
What I tried doing was making the formula itself an option in the drop down list, but this doesn't adjust to the cell addresses for each item, and only shows one static value.
One option I thought of was to limit the data validation list with just the "Ready" option, so that the user can just delete the cell. A VBA code will then detect the blank cell and will return the formula it initially had. Unfortunately, I don't really know VBA or any programming. I can however understand and have managed to use and modify VBA codes posted in the internet according to my previous needs. I tried searching for a code, but to no avail.
If you could give me good references (not a whole book please) relative to this, I would really appreciate it. If you're feeling benevolent and help me with the coding, thanks! However, if there's a non-VBA solution, then I would really like to know more about this. Thanks all!
Sample list
I have two columns in an Excel sheet containing Project names (Column A) and Fields (Column B) and I'm trying to add hyperlink for each row to local files. There's one specific local file for each row.
I don't know how to use Hyperlink function to get the corresponding URLs automatically because there are around 10,000 Project names. I also don't know if it is easier to use VBA.
The URLs are all identical except from "projects":
\nas1\backup\dop4\jobdata\projects\34s\34038 - 10 Wharaora Tce\Structural
The Project name in Column A is something like 34038, 25794 etc. and Filed in Column B is something like Structural, Civil etc.
So my plan is to write a VBA program that adds hyperlinks using URLs constructed from:
\nas1\backup\dop4\jobdata\projects
Because the Project name in column A is 5 digits, I'm thinking of using the LEFT function to get the first two digits to find the files after "Project file".
Folders
Excel file
A data sample will certainly help to understand what you are trying to achieve. Please update your question and then leave a comment to notify people who are watching this thread.
As far as I understand your question, you want to concatenate several cells into a string that can then be used to construct a hyperlink. Consider this screenshot
the formula in cell C2 is
="\nas1\backup\dop4\jobdata\projects\"&LEFT(TEXT(A2,"0"),2)&"s"
Copy down. In D2 you can use the Hyperlink() function to refer to the Address in C2, or wrap a hyperlink function around the formula in C2.
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...
I have an Excel workbook in which I have several tables. On 3 of my sheets, there is some kind of "main" table which differ a bit from one another.
These tables are 2 lines by default (1 header and 1 data row) and extend when I add a new line below the one already existing. In some of the fields are formulas which are using values from the other tables. However, if for example, I insert a new value in a field below the final row, thus adding another row to the table, I want the tables in the other sheets to also add another row (and execute the formulas that are in the new row)
This is the sheet in which I have "Soorten Vezels" with their corresponding "max demping" and "soorten connectoren" with their corresponding "max demping":
This is the "maximale demping" file:
This is the measurement form, in this form, the user should not have to enter anything, except for the 2 dropdown menu's "type kabel" and "type connector":
What I would like is that when the user for example, inputs the length ("lengte") in the "maximale demping" file, a new row gets added (the fields "kabelnr", "van" and "naar" will be filled in automatically from the "gegevens" file)
But I would also like the workbook to add a new line in the measurement form, automatically fills in the "kabelnr", "van" and "naar" fields. So that I only have to choose the "type kabel" and "type connector" from the dropdown menu.
How do I do this (with VBA)?
Personally I like the MSDN when I am looking for answers to VBA and vb.net. I have found it to be thorough and comprehensive. The more I learn, the more I understand what they are teaching on this site.
This is a good tutorial to get started. Follow the links from this page.
Getting Started with VBA in Excel 2010
http://msdn.microsoft.com/en-us/library/office/ee814737(v=office.14).aspx
Also remember to search Stack Overflow as you progress, there are an amazing number of questions covering specifics you may require when you start, or ask more questions.
If you require further assistance you can look at the links below.
This link is helpful. But I would navigate through the links below to get a broader view and to find an explanation that works for you.
Insert Row in Tables Multiple Sheets Excel 2010
http://chandoo.org/forums/topic/insert-row-in-tables-multiple-sheets-excel-2010
A forum- this link leads to a question about inserting rows.
MrExcel.com
http://www.mrexcel.com/forum/excel-questions/58685-insert-rows-between-different-data-2-a.html
If you persevere, down the page, there is good discussion, with code examples and trouble shooting (you will get a pop up when you go to this link asking to sign up for the newsletter, you can disregard this without a problem)
Insert Row in Tables Multiple Sheets Excel 2010
http://chandoo.org/forums/topic/insert-row-in-tables-multiple-sheets-excel-2010
A useful Q&A from Microsoft forum.
Insert blank rows in excel table with vba
http://answers.microsoft.com/en-us/office/forum/office_2007-customize/insert-blank-rows-in-excel-table-with-vba/69e369a8-e656-4f68-adcd-c57e37253f12
Please let me know if this helps and ask new questions freely as you go.