Fixed Number of Columns

After manipulating data in Excel I would like to copy and paste the data in a text editor.  The data should be in fixed format, for example integer numbers should end in columns with multiples of 5.  The text is then used as input to an old fashioned program which requires that the data be aligned

I changed the font in Excel to Courrier New and then selected a column width of 5.  When I copy the data to a text editor it copies some tab marks and the columns do not align.  How can I make things align in the text editor?
0
ftajiria (1)
2/18/2004 7:36:06 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
318 Views

Similar Articles

[PageSpeed] 59

Vino,

You can use a macro: copy the code below, then paste into a module, and run
it while the sheet with the data is active.

HTH,
Bernie
MS Excel MVP

Sub ExportTo5WideColumnsPRN()

Dim FName As String
Dim WholeLine As String
Dim FNum As Integer
Dim RowNdx As Long
Dim ColNdx As Integer
Dim StartRow As Long
Dim EndRow As Long
Dim StartCol As Integer
Dim EndCol As Integer

FName = Application.GetSaveAsFilename( _
    Left(ActiveWorkbook.FullName, _
        Len(ActiveWorkbook.FullName) - 4) & ".prn")

Application.ScreenUpdating = False
On Error GoTo EndMacro:
FNum = FreeFile


With ActiveSheet.UsedRange
    StartRow = .Cells(1).Row
    StartCol = .Cells(1).Column
    EndRow = .Cells(.Cells.Count).Row
    EndCol = .Cells(.Cells.Count).Column
End With

Open FName For Output Access Write As #FNum

For RowNdx = StartRow To EndRow
    WholeLine = ""
    For ColNdx = StartCol To EndCol
        WholeLine = WholeLine & Right(Space(5) & _
            Cells(RowNdx, ColNdx).Text, 5)
    Next ColNdx
    Print #FNum, WholeLine

Next RowNdx

EndMacro:
On Error GoTo 0
Application.ScreenUpdating = True
Close #FNum
Rows(1).Delete
End Sub

"vinoareni" <ftajiria@pacbell.net> wrote in message
news:E6D9DDD3-56E7-417B-B684-94905805F4C5@microsoft.com...
> After manipulating data in Excel I would like to copy and paste the data
in a text editor.  The data should be in fixed format, for example integer
numbers should end in columns with multiples of 5.  The text is then used as
input to an old fashioned program which requires that the data be aligned.
>
> I changed the font in Excel to Courrier New and then selected a column
width of 5.  When I copy the data to a text editor it copies some tab marks
and the columns do not align.  How can I make things align in the text
editor?


0
Bernie
2/18/2004 9:40:54 PM
Reply:

Similar Artilces:

show columns on other worksheet without using formulas
Hi, I have 1 worksheet containing lot's records. Just like in access, each line is 1 record, and each column contains data. ex: WORKSHEET 1: name title address city 1 dfjw kjhk kjhkj kjhk 2 lmkj lkjlk lkjkuf guyg 3 drdtg xcx yjutuy hgyy Now I want to have a selection of columns on worksheet 2: ex, only name and title: WORKSHEET 2: name title 1 dfjw kjhk 2 lmkj lkjlk 3 drdtg xcx I will only add/modify rows in worksheet 1. And I want that this is filled automaticaly in worksheet...

Sequential Numbering in Word 2003 and Recycling unused numbers
Once again, I am stuck in Macro world which is quickly consuming me :) It is though, quite addictive and I am determined to win the fight I'm having with my PC. I work for a company which uses network servers so the document needs to be accessed by different people but not necessarily at the same time. We operate Windows XP Word 2003. I am trying to create a document that will open with a sequential number, but if the document is not used or opened accidentally then the number it has generated needs to be recycled for auditing purposes. I seem to be able to get the number t...

Number of categories between tick-marks
How do you change the "number of categories between tick-marks labels" setting under Scale of Category (x) axis scale from code? Thanks, Clint Hi, The macro recorder generated this. With ActiveChart.Axes(xlCategory) .TickLabelSpacing = 1 End With Cheers Andy cherman wrote: > How do you change the "number of categories between tick-marks labels" > setting under Scale of Category (x) axis scale from code? > > Thanks, > Clint ...

Case numbering 01-26-04
I have found the auto numbering in 1.2, but it only lets me change the prefix for the cases "CAS". I need to start my numbering at 3500 instead of 1000. Is there a way to change the starting number? Thanks, Stefanie ...

how do Ii remove the grey page numbers in a work sheet
how do Ii remove the grey page numbers in a work sheet Try going to the View menu and unchecking Page Break Preview On Wed, 2 Feb 2005 11:01:08 -0800, "parker1230" <parker1230@discussions.microsoft.com> wrote: >how do Ii remove the grey page numbers in a work sheet You may be in page break preview mode. Go to "View" and select "normal" Regards Bill K "parker1230" <parker1230@discussions.microsoft.com> wrote in message news:5A65FC73-CAA0-428D-8ECD-0C2A2E15B799@microsoft.com... > how do Ii remove the grey page numbers in a work she...

Im desperate to fix my fragmented memor...will advanced server save me with the 3 gb switch?
Im desperate to fix my fragmented memory, will advanced server save me with the 3 gb switch? The Situation: -Server=Windows 2000 Server sp4. -2.5 gb of RAM -Exchange=Enterprise Ed with all service packs and hotfixes. -Group Shield virus scanning Every month I recieve eventid 9582's errors, and then 12800 mail processing errors. THIS IS FREAKING KILLING ME AT WORK. Here is what I have tried. -Regedit ajustment to the heep. -ADSI ajustment to the IS (which oddly removes the errors from the event log, however MOM still detects low virtual memory errors). -sp3 (which claims to have fixed ...

Excel 2007
When you set reverse categories for the horizontal axis, I noticed that the legend (which I normally placed at the bottom of the chart), did not correspondingly reverse. Is this WAD (working as designed) ? If not, how can i overcome this as the reader would have to mentally "remap" the legend to the bar chart. Thanks very much. Hi, Reversing the Axis categories will not effect the legend order. To do that you need to change the Series Order. In 2007 this is none via the Select Data Source dialog. Chart Tools > Design > Data > Select Data. Use the Up/Down arrows in the...

how do i split a column
i have a worksheet with three columns but want to split column C in to two from row 37 down while keeping only three columns from rows 1-36. How can i do this? You can't. You could merge C1 & D1, C2 & d2 etc. but it seems a bit of overkill. What is the reason for this, there may be another solution? -- HTH RP "craig.d" <craig.d@discussions.microsoft.com> wrote in message news:973F49DB-EF87-4F64-AA13-7AEB3563757A@microsoft.com... > i have a worksheet with three columns but want to split column C in to two > from row 37 down while keeping only three col...

How to you selectively sum on a series of numbers?
I have a column filled with numbers, but I only want to sum up a few of them. Let's say I have numbers filling A1:A10. Let's say I only want to sum up the numbers located is A3 and A4. I'd like to ability to enter something in the b column (e.g. "y" in cells b3 and b4) and have a formula that adds up the values in the "A" cells that have a corresponding "y" in the "B" column. This formula would allow me to selectively choose which cells needs to be summed. What is the best/cleanest way to write that formula? Thank you. =SUMPRODUC...

How do I reduce the number of data points I have??
Hi , I have some 10000 data points from which I need to reduce to something like 100 points before making an xy chart. Typically I would like to make a chart of every 10th point. So basically I need to reduce the length of my two rows. Is there any way I can do this easily?? Any help is highly appreciated. Thanks in advance -- swapan From the Microsoft Charting FAQ: http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=209#jon024 - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ ssan...

Chart
Hello, I created a line column chart on 2 axis. I have four data sets. The first 3 should go on the primary Y axis as columns and the 4th should go on the secondary Y axis as a line. However, Excel wants to automatically put both the 3rd and 4th data sets on the secondary axis as lines. I cannot find any command to change the 3rd data set to go onto the primary axis as a column. Any suggestions would be most appreciated! -Patty On Tue, 11 Nov 2003 13:27:33 -0800, Patty = <anonymous@discussions.microsoft.com> wrote: > Hello, > > I created a line column chart on 2 ...

Automatic number fill-in on Labels
Is it possible to have word automatically fill in a series of numbers on Labels. I need a set of labels, counting by fives, from 1 to 3500. Just wishing I didn't have to key in every number....0001-0005, etc. See http://www.gmayor.com/Numbered_labels.htm. -- Stefan Blom Microsoft Word MVP "Bridgett" <Bridgett@discussions.microsoft.com> wrote in message news:9D380870-FF28-4227-B724-301AC3EC9A8D@microsoft.com... > Is it possible to have word automatically fill in a series of numbers on > Labels. I need a set of labels, counting by fives, from 1 ...

converting from text to numerical number
I have a spread sheet of entire year schedule. The format as following: 1 2 3 .... 31 row 1 row 2 row 3 Jan row 4 row 5 Feb row x Dec I would like to replace column 1 up to Jan to 1. Replace the cell below Jan to Feb to 2. etc. Would anyone help. Thanks in advance. You could select cells A1:A3, type a 1, then press Ctrl+Enter Select A4:A5, type a 2, and press Ctrl+Enter And so on, till all twelve months are done. james wrote: > I have a spread sheet of entire year schedule. The format as following: > > 1 2 3 .... 31 &...

Column names are 1,2,3,....
I just noticed today that the column names in my excel spreadsheets are no longer alphabetical, but are numerical. The column marked "1" is defined by excel as column "1C", and row "1" is defined as row "1R". How can I get the column names to change back to the alphabet? Thanks Hi! G! Use: Tools > Options > General Remove check from "R1C1 reference style" -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good...

Splitting multiple cell contents from 1st column into 4 columns
n my first column I have 4 cells (1-4) (5-8) etc. with general content. The content from each of these 4 cells needs to be placed in a separate column to make a list that I can sort etc. Example: COLUMN A 1 01-04-425-001 2 Heatherridge Road #301 3 Harry Smith 4 H25 Condo Fairfax Place 5 01-05-356-041 6 McGrath Street # 56 7 Mary Jones 8 B45 Condo Lemon Circle . . . . . . and so on and so on every 4 cells. I have hundreds of 4 cell descriptions. I just can't do this one by one. Can anyone help, PLEASE, PLEASE. I am really a novice at Excel though I use it for e...

Activate email column to hyperlinks
I have a colume of email addresses in an excel 2002 document. I need to make them active hyperlinks - How ? Microsoft instuctinos are useless here. can't they be converted in one batch to active hyperlinks so when the email address is clicked on, the email program opens in a fresh email ? Many thanks for any help http://www.mvps.org/dmcritchie/excel/buildtoc.htm#MakeHyperlinks -- Regards, Peo Sjoblom "DixieWins" <DixieWins@discussions.microsoft.com> wrote in message news:7F59C7F2-63DE-410B-B6FF-0EA29ECC8A35@microsoft.com... > I have a colume of email addr...

Converting a number to Hour & Min format
I am attempting to take a basic number, say 2000, and convert the number into an hour and minute format (i.e. 33:33) only. Everytime I use the custom format tab or the time/date tab I get a date included or an AM/PM setting. Any ideas or suggestions? Thanks in advance. Hi, For any number to be converted into time format you need to divide tha number by 24, since Excel time code is 24 (hr) code. then you forma the divided answer (83.33) into time, you will get 8:00 regards sazi -- Message posted from http://www.ExcelForum.com Use Format/Cells/Number/Custom [hh]:mm In article <...

Invalid column name 'ASSN_ENTSUMPROJID'
I have Project Server 2003 with SP3, SQL2005 database When i am saving a project to the Project Server, i am getting the following message: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'ASSN_ENTSUMPROJID' This is happning to just one project. Please help me understand the reason behind this and if you have a solution to fix this issue. Thanks VM Find the stored procedure executing that SQL command, name of the stored procedure is in the same line of the log (ULS). Go to the procedure and re-compile it, ensure there are no red-underlined lines. ...

Label of Number in a Range
I have set a high and low range of values with a correponding label, how do I return the label of the range where the data point fits? For example, ColA ColB ColC 5 10 Low 11 20 Medium 21 30 High D1 has the value 13 how do I get E1 to return the label "Medium" Thank you Hi Try: =VLOOKUP(D1,A2:C4,3) -- Andy. "webnntp" <webnntp@yahoo.com> wrote in message news:d1d35423.0405120719.7be94baa@posting.google.com... > I have set a high and low range of values with a correponding label, > how do I return the label of the range where the data point ...

Checkbox column in a table
Hi Everyone, I am a newbie in MS Access. I want to write a query for altering a table such that the new column added should be of type checkbox (which can be done by the design by going to Lookup tab in the design form). So when I open up the table that particular column should be like all filled with checkboxes. (By Default it will be Textboxes). And also how to give a default value to the checkbox ? Please help me out... ! On Tue, 25 Sep 2007 12:52:20 -0700, Cormalado <Cormalado@discussions.microsoft.com> wrote: >Hi Everyone, > >I am a newbie in MS Access. I want to w...

IE6 ignore font size setting = Outlook fixed 12-pt messages
Setting IE6's Accessibility option to Ignore font sizes specified on web pages (so I can read online newspaper text at my 1600x1200 resolution setting) produces an undesirable side effect in my Outlook 2K-generated html- format email messages: all message text is fixed at 12 point, even though my Outlook default message size is set at 10 point. Manually changing the font size in the message has no effect. Closest KB article I can find is one for Outlook Express (#178895), which indicates "this is by design." If so, why would someone who wants to vary the font size displa...

length of lot number
increase the amount of characters in the lot number field. current field length is not ample space to adequately describe lots in our organization. Length of the item description was increased to 100. In our case, lots are as important as items. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agre...

Inserting Columns
I am trying to insert a column on a worksheet and keep getting the message: : "to prevent possible loss of data Microsoft Excel cannot shift nonblank cells off the worksheet". I am using Excel 2000. I have no protection set and no merged cells anywhere on the worksheet. It does no matter where I shift the cell pointer and try to do the insert, I get the above message. I have used Excel for many years and have never seen this problem before. I'm sure there must be something obviouis I am missing, but have no idea what it could be. Please help Thanks Thanks You ...

Adjusting column widths to fit text plus extra space
I can get Excel to adjust one or more columns to fit the data by selecting the columns and double-clicking on one of the column header borders. The result is the smallest possible width for the existing data. This is a little too tight for optimum viewing. Is there a way to tell excel to choose a width that is slightly wider? In Word, there is a *Cell Margin* setting for tables. Is there anything similar in Excel? Column Auto-width has no cell margins parameters that can be set. Gord Dibben MS Excel MVP On Tue, 14 Jun 2011 06:50:36 -0700, Jennifer Murphy <JenMurphy@geospace.org>...

HKLM\Software\Microsoft\RPC\ClientProtocols reg fix didn't work
Hello, I have been experiencing the "RPC system component not configured correctly" problem that has been floatin' around. I tried adding the missing values to the registry but I am still receiving the error message. I am running Outlook 2003 on Windows XP SP1 against Exchange 2000. I have tested connectivity with Ping and RPC Ping. I have tested the mailbox with other computers that have Windows XP and Outlook 2003 installed. Also, I rebooted my computer to make sure that the RPCSS picked up the registry changes. Does anyone have any additional suggestions? Thanks, - Josh...