There are a couple of ways to approach this, if you wish to preserve the data. ![]() This will not work the same way in Word as hiding a row (it will hide the data, but not the actual column width). I just noticed that you want to "hide" the first column, not the first row. It can be very frustrating to try to help someone only to find out they have been asked and answered elsewhere. Lastly, since this is your first post: if you have cross-posted this question elsewhere, please provide links to all of the places you've crossposted. Use the VBA tags, it will make your posted code much easier to read.ĥ. no sensitive data, please, but a table structure of the type you want the macro to run on would be very useful.Ĥ. Can you post a sample document with a sample table of the type you're dealing with, including any headers, structure etc. At that point, you start having trouble referring to individual rows/columns via code.ģ. What is difficult in Word is dealing with tables which contained *merged* cells (whether vertically merged or horizontally merged). You can affect columns of different widths. You can apply font formatting "hidden" to an entire row, but that may or may not be same result.Ģ. Hiding rows in word tables is not quite the same as in Excel. I appreciate any help/insight on this one! Thanks a ton!ġ. ' Adds Shading based on True/False in Column A (True gets shading)Ĭonst TEST_COLUMN As String = "A" '<= change to suit ![]() ![]() ' Removes any previous shading to start clean We came up with a similar one in excel (It's a li'l different though), But I'm not sure if I can apply it to word. Tables have differing column widths (These are balance sheets with headers embedded in a word doc.)- I mention this, because I did a search and I came across a post that said, it's not possible to change/manipulate a table with different column widths.Ģ.After the macro has scanned and applied the relevant colours to the rows, it should hide the first column for every table. Shade the row blue if the value in the corresponding first column is TRUE and if it's false, shade it green Scan through the word document for tables. I'm trying to write a macro in word that would do the following. This is my first attempt at learning/writing VBA code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |