Prev: Userform problem with "Run Time Error 75"
Next: ExportAsFixedFormat : differences between Excel and Word
From: Nit_Wit_400 on 29 Dec 2009 10:40 Office Excel 2003 on Windows XP I'm trying to create a report-maker with excel... ugh! Anyways, there is a template that users are filling out saying whether something is defected or not... that's not important, the important part is, that I'm having VBA go though the table (using a button after it is filled out) and deleting the rows that aren't defected... in other words, if there are blank cells in column C (for example), the whole row in which that blank cell is located is deleted. I'll never have more than 40 rows and 5 columns in the table so I don't think I'll exceed Excel's maximum character limit per cell. What I want to do next is put that whole table in a new sheet in the first blank cell in row 2 so that I can make them mergable into a Word document (which will have all 256 possible merge fields in place). As you've probably guessed, I'm going to be doing this multiple times per report. I guess the most basic question to ask here is: How do I copy a whole table and paste it into one cell?
From: joel on 29 Dec 2009 11:01 If you plan to export the data to word I would recommend saving the data to an html file and then importing that file into word. This method is the same as you would export data froman excel document into an email letter which are both html format. Take a look at Ron Debruins website for the code on exporting tables in excel into html files. Then read the saved file into a word application. I can help with the code once you decide the methods you plan to use. Ron wrote an aritcle that got published on the microsoft web site: 'Working with Excel Workbooks and Worksheets in E-Mail' (http://msdn.microsoft.com/en-us/library/bb268022.aspx) Ron's webpage is 'Ron's Excel Test Site' (http://www.rondebruin.com) or 'Ron's Excel page' (http://www.rondebruin.nl) -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=165640 [url="http://www.thecodecage.com"]Microsoft Office Help[/url]
From: Nit_Wit_400 on 29 Dec 2009 15:17 Problem is, I've already got it set up to work as I explained... I thought I could figure out how to put a table into one cell but when I got to that point I couldn't figure it out, hence my reaching out for help... Are you suggesting there isn't a way to do what I'm asking? If not... bummer... but thanks anyways! P.S. I'm saying "table in one cell" but I guess I should be saying "range in one cell." Is there like a Text Only function or something?
From: joel on 29 Dec 2009 15:51 You can either put convert the table to a picture and past it on top of the worksheet (not into a cell) or concatenate the text into a single cell. Once converter to text you would be able to change the data. A cell can contain up to 32,767 characters but only the 1st 1024 characters are visible. Then I'm not sure how the data will look when you put it into word. It would be better just to save the worksheet as text and then import the data into word as text. If you are saving to a temporary file why not just save to html like I suggested. -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=165640 [url="http://www.thecodecage.com"]Microsoft Office Help[/url]
From: Tim Williams on 29 Dec 2009 19:02 You can't copy a table into a cell. Best you could do is convert to text, and use a non-proportional fonf (fixed-width, like courier for example) and pad field values with spaces so everything lines up. You'd have to use a non-proportional font in your Word doc as well for it to look half-decent. Most likely there's better approaches: the best one would depend on what you need to do with the reports once they're generated. If you're just printing, it might be easier to lay it out in XL. Tim "Nit_Wit_400" <kflinspach(a)gmail.com> wrote in message news:b9875cc9-46aa-44aa-a0b1-8f24604d1fb1(a)u37g2000vbc.googlegroups.com... > Office Excel 2003 on Windows XP > > I'm trying to create a report-maker with excel... ugh! > > Anyways, there is a template that users are filling out saying whether > something is defected or not... that's not important, the important > part is, that I'm having VBA go though the table (using a button after > it is filled out) and deleting the rows that aren't defected... in > other words, if there are blank cells in column C (for example), the > whole row in which that blank cell is located is deleted. > > I'll never have more than 40 rows and 5 columns in the table so I > don't think I'll exceed Excel's maximum character limit per cell. > > What I want to do next is put that whole table in a new sheet in the > first blank cell in row 2 so that I can make them mergable into a Word > document (which will have all 256 possible merge fields in place). > > As you've probably guessed, I'm going to be doing this multiple times > per report. > > I guess the most basic question to ask here is: > > How do I copy a whole table and paste it into one cell?
|
Next
|
Last
Pages: 1 2 3 Prev: Userform problem with "Run Time Error 75" Next: ExportAsFixedFormat : differences between Excel and Word |