This is a discussion on Excel question within the Microsoft Office forums, part of the Operating Systems, Servers & Software category; Ok, I export some data from another application where the data is layed out like so: desc. - pn - ...
| |||||||
|
#1
| ||||
| ||||
| Ok, I export some data from another application where the data is layed out like so: desc. - pn - so - qty tool1 - 123 - so383-4 tool2 - 223 - so383-3 tool1 - 123 - so444-2 tool4 - 334 - so444-3 Is there a way to take this data and easy make rows according the the qty in excel? or maybe put it into access and have it spit out the rows. make it into: desc. - pn - so - qty tool1 - 123 - so383 -1 tool1 - 123 - so383 -1 tool1 - 123 - so383 -1 tool1 - 123 - so383 -1 tool2 - 223 - so383 -1 tool2 - 223 - so383 -1 tool1 - 123 - so444-1 tool1 - 123 - so444-1 tool4 - 334 - so444-1 tool4 - 334 - so444-1 tool4 - 334 - so444-1 |
|
#3
| ||||
| ||||
| manually after i've got the data. |
|
#4
| ||||
| ||||
| Go to Tools...Sort... You select whether you have a header row or not with the radio buttons.. That'll either show the column headings in the dropdown if you have one or just Column A, B etc. if you don't. Then just select what you want to sort by and which way. Hope that helps. |
|
#5
| ||||
| ||||
| Quote:
am i missing something? |
|
#6
| ||||
| ||||
| Hi Rebelle, This is the best i can come up with,. i've attached an example for you to look at,.. long story short,. just make sure the value is held in column D,.. obviously you can change the range though ![]() Code: Dim lngRow As Long
Dim intInsertRows As Integer
Application.ScreenUpdating = False
lngRow = 1
Do Until IsEmpty(Range("D" & lngRow))
If Range("D" & lngRow).Value > 1 Then
intInsertRows = Range("D" & lngRow).Value - 1
Range("D" & lngRow + 1 & ":D" & lngRow + intInsertRows).EntireRow.Insert
Range("A" & lngRow & ":D" & (lngRow + intInsertRows)).FillDown
Range("D" & lngRow & ":D" & (lngRow + intInsertRows)).Value = 1
lngRow = lngRow + intInsertRows
End If
lngRow = lngRow + 1
Loop
End Sub
__________________ If i helped you, make me famous by clicking the ![]() Status: Currently Unemployed - Looking for Work, Can be contacted on thethresher@hotmail.co.uk |
| The Following 3 Users Say Thank You to AOG123 For This Useful Post: | ||
|
#7
| ||||
| ||||
| Or you can simply use the "text to columns" feature of Excel. I believe you can find that under Data -> Text to Columns.
__________________ "You'll never be as perfect as BLaaaaaaaaarche." |
|
#8
| ||||
| ||||
| Quote:
Out of curiosity i had a look into your sugestion but couldn't get the results as required above,. So for the moment lets assume i'm losing the plot, ![]() I thought Text to Column command allows you to break text in one column into several columns using a delimiter such as <space> <hyphen> etc. I.e "delimiter being <space> in this case" Code: Cel 1 Developer Barn Code: Cel 1 Cell 2 Developer Barn |
|
#9
| ||||
| ||||
| With the data provided, all you have to do is the following: 1. Copy and paste the values into Excel. 2. Select column A. 3. Click on Data -> Text to Columns 4. Check 'Delimited' 5. Check 'Other' and enter in '-' as your delimiter. 6. Click next. 7. If data looks formatted correctly, click Finish. I just did it and it works perfectly okay. |
|
#10
| ||||
| ||||
| but what she wants to do ... is take this line in excel: Code: tool1 - 123 - so383-4 (no dash delimiters ... she was showing the columns) Code: tool1 - 123 - so383 -1 tool1 - 123 - so383 -1 tool1 - 123 - so383 -1 tool1 - 123 - so383 -1
__________________ Quote of the Month: Mistakes: It could be that the purpose of your life is only to serve as a warning to others. Questions to Ponder: Why do banks charge you a "non-sufficient funds fee" on money they already know you don't have? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright © 2008 sbenj69 Sarchasm: The gulf between the author of sarcastic wit and the person who doesn't get it. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C# database question | peebman2000 | .Net Development | 19 | April 21st, 2008 03:23 PM |