Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2002, Win XP, SP-2
I'm trying to create a pre-formatted template that uses a macro to import data from a tab delimited file. I would like to fix the column widths so they do not change during data import. Now, when the data imports, the column widths automatically adjust themselves to fit the data. How can I create a template and fix the column widths so they do not change during data import?. I know I can add the column widths to the macro it self, but since I create many templates, this is tedious. -- John Garate |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim varr(1 to 10)
for i = 1 to 10 varr(i) = activesheet.columns(i).Columnwidth Next ' code to import text file for i = 1 to 10 activesheet.columns(i).Columnwidth = varr(i) Next That shouldn't be too tedious. another approach would be to add a (dummy) sheet, import into that sheet, then do and edit copy and go to the target sheet and do an edit pastespecial, values, then delete the dummy sheet -- Regards, Tom Ogilvy "John Garate" wrote in message ... Excel 2002, Win XP, SP-2 I'm trying to create a pre-formatted template that uses a macro to import data from a tab delimited file. I would like to fix the column widths so they do not change during data import. Now, when the data imports, the column widths automatically adjust themselves to fit the data. How can I create a template and fix the column widths so they do not change during data import?. I know I can add the column widths to the macro it self, but since I create many templates, this is tedious. -- John Garate |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Column Widths When Printing | Excel Worksheet Functions | |||
Excel 2007 B2TR - Can't keep Column Widths | Excel Discussion (Misc queries) | |||
Excel 2003 - column widths | New Users to Excel | |||
Changing column widths in excel | Excel Discussion (Misc queries) | |||
Excel column widths | Excel Discussion (Misc queries) |