Dear Ashish, The columns are fixed. The number of rows is not. The rows are deleted, depending upon whether or not data is entered in them. E.g. sometimes a table may have 20 rows, sometimes 30 and sometimes only 3.
To give an idea behind the whole thing: 1. I have a comprehensive word template ~ 100 pages. Where-in lots of tables are completely deleted, and in certain tables - specific rows are deleted depending upon whether or not any data is entered in those rows. All in all, the final report comes out to only 40-50 pages. 2. Though the word template works fine, almost half of the time is spent in "deleting rows", "deleting tables" and providing suitable "page-breaks" etc... to make the whole thing presentable. 3. Also, a lot of erroneous entries are made by the user when entering the data - such as wrong values (31 instead of 13), misplaced decimal points (13.1 instead of 1,31) etc... 4. The idea of using Excel is to firstly control the data entry (using conditional formatting, or data validation rules) so that incorrect values are flagged and secondly to automate the deletion of undesired tables or specific rows, as the case may be - this using VBA. This part is all working fine in my Excel template. 5. However, as I said earlier, the final submission has to be in Word, and so I need to transfer all these 30-40 Excel Worksheets on a Word document, one behind the other, which is also working fine. I get the whole data copy-pasted in exactly the same order as desired. 6. The only issue where I struggle is with "Column Width". When I copy-paste from Excel to Word using VBA, the Column-Widths change for certain cells and I'm unable to figure out why it is so; and also unable to figure out any alternate methods to do so. Any guidance with this Column Width issue? Regards, Jewel On Tuesday, 27 November 2012 22:37:18 UTC+8, ashish wrote: > > if you rows and columns are fixed why do u create a blank template in word > document , merge cells , row ,etc as per your need > > Then run a loop through all the cells in table to add data in word > document > > > Regards > Ashish > > On Tue, Nov 27, 2012 at 6:15 PM, Jewel Sharma <jewel...@gmail.com<javascript:> > > wrote: > >> Guys - I'm facing issues with "column width" when pasting from Excel to >> Word. >> Briefly, >> >> - I have an Excel file comprising of several worksheets. Each >> worksheet comprises of several tables (with specific column width and row >> heights). >> - Certain cells within these tables are merged while others are >> single cells (not sure if this is relevant, just preempting a query). >> - This sheet helps to collect the data in an orderly manner at the >> specified location (data is entered manually at the specified cells). >> - After all the data is gathered, I need to transfer (read >> copy-paste) it to a word document as the submission needs to be in MS >> Word. >> - When I do that, I find that column widths for certain cells are not >> maintained as they are in Excel - I observe both increase and decrease in >> Column Width sizes. >> - However, the results are consistent. By that I mean, everytime I >> run the macro, the same cells/or group of cells are affected. >> - I have tried using Word "Selection.PasteSpecial" from within Excel >> with Link:= true and false both, Placement:=wdInLine >> DisplayAsIcon:=False, >> Data:=wdPasteHTML >> - I have also tried using calling a function in the word document >> (Word "Selection.PasteExcelTable" False False False) from within excel, >> but >> still having the same issue with the same cells. >> >> Is there a solution to ensure that the column widths remain exactly the >> same when pasting from Excel to Word? >> Has cell padding got anything to do with it? I noticed that the Excel >> cells have "zero" padding, whereas the default indent in MS Word Tables is >> "0.19cm". >> >> Any help or guidance would be appreciated. >> Regards, >> >> Jewel >> >> PS: If a similar query has been posted before - kindly direct me to that >> post. >> >> -- >> Join official Facebook page of this forum @ >> https://www.facebook.com/discussexcel >> >> FORUM RULES >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> 2) Don't post a question in the thread of another member. >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> 4) Acknowledge the responses you receive, good or bad. >> 5) Jobs posting is not allowed. >> 6) Sharing copyrighted material and their links is not allowed. >> >> NOTE : Don't ever post confidential data in a workbook. Forum owners and >> members are not responsible for any loss. >> --- >> You received this message because you are subscribed to the Google Groups >> "MS EXCEL AND VBA MACROS" group. >> To post to this group, send email to excel-...@googlegroups.com<javascript:> >> . >> To unsubscribe from this group, send email to >> excel-macros...@googlegroups.com <javascript:>. >> Visit this group at http://groups.google.com/group/excel-macros?hl=en. >> >> >> > > > > -- > *Regards* > * * > *Ashish Koul* > > > *Visit* > *http://www.excelvbamacros.com/* > *http://www.accessvbamacros.com/* > > P Before printing, think about the environment. > > > > -- Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To post to this group, send email to excel-macros@googlegroups.com. To unsubscribe from this group, send email to excel-macros+unsubscr...@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en.