I am work a worksheet that contain the data like that
A B
NUM1 Jene,Joly
NUM2 Jene,Selo,Diff
MUM3 Tino,Selo
………………
this worksheet has over 1,000 data.
i want get the result in sheet2 as below:
A B
NUM1 Jene
NUM1 Joly
NUM2 Jene
………………
i write the code
[PHP]Sub test()
Dim i As Integer
Dim arr() As String
Application. ScreenUpdating = False
On Error Resume Next
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
arr = Split(Cells(i,2), ",")
For J = 0 To UBound(arr)
With Worksheets(2)
LASTROW = .Cells(Rows.Count, 2).End(xlUp).Row + 1
.Cells(LASTROW, 1) = Cells(i, 1)
.Cells(LASTROW, 2) = arr(J)
End With
Next J
Next i
Erase arr
Application.ScreenUpdating = True
End Sub
[/PHP]
the defult of this code is that it will take long time to get the result.so,i want to know how to make the code run fast.
I'm looking for a way to convert an old church address list that is formatted in a single column. There are no blank rows, but the amount of rows for each entry can vary. For instance, there could be as little as 3 rows of data (church name, address, city/state/zip) or more if email addresses and websites are provided.
The data is currently in the format below (notice how one entry has a website while the other does not).
First Church 102 Main Street Dallas, TX 12345 email@whatever.com Second Church 500 Second Street Austin, TX 12376 email2@whatever.com http://www.boguswebsite.com
So I'm looking for the data to be formatted like the following:
First Church 102 Main Street Dallas, TX 12345 email@whatever.com Second Church 500 Second Street Austin, TX 12376 email2@whatever.com http://www.boguswebsite.com
I was able to find the following code from a Google search, but it can't dynamically adjust the range.
Sub x() Dim rng As Range
Set rng = Range("A1").Resize(5) Do Until IsEmpty(rng.Cells(1, 1)) rng.Copy Cells(Rows.Count, "B").End(xlUp).Offset(1).PasteSpecial Transpose:=True Set rng = rng.Offset(5) Loop
End Sub
I think what I need to make this code work is a way to dynamically adjust the range so that it can determine when to move to the next row of data. Static ranges break the process due to the amount of data being provided not being uniform. What I was thinking is that I could use the word "church" as a start point and end point in a loop so the script knows when to jump to the next row and begin copying the proper number of columns. I'm just not sure how to accomplish this in vba.
I have a very large sheet of all US zip codes by county name. Unfortunately, the document builder decided to list up to EIGHTEEN columns of zip codes per county name... I assume to make it easier to look at.
I now need to rebuild the sheet to have one column of county names and *one* column of zip codes, which will be a nearly impossible task if I don't find a way to automate the conversion.
Attached is a sample... sheet 1 is my initial state (except here its 5 columns rather than 18), and sheet 2 is my hoped for end state. Notice that the zip codes can, but don't always, fill every column allotted.
I'm currently faced with a spreadsheet that has data formatted like this: A 1 RandomRowofData1 2 RandomRowofData2 3 RandomRowofData3 4 RandomRowofData4 5 RandomRowofData5 6 RandomRowofData6 7 RandomRowofData7 8 RandomRowofData8 9 RandomRowofData9
Every 9 rows, a new "set" of data repeats itself (wow, this is so hard to put into words)....
I need to figure out a way to get the data in column "A", every 9 rows, to transpose itself into 9 separate columns.
I have a long list of names, address, city state zip, and phone number, followed by the next name, address, etc. I need to now be able to bring each one into it's own column.
Example: David Smith 123 Main St. Denver, CO 12345 123.456.7890 Joe Blow 345 Happy Ave. Oakland, CA 34567 567.890.1234
I need to convert it so that I would have
David Smith 123 Main St. Denver, CO 12345 123.456.7890 Joe Blow 345 Happy Ave. Oakland CA 34567 567.890.1234
How to convert multiple Rows recors to a single row record in a Notes(csv) format? Have update my xls file. My source is in the below format(Source.xls):
As you can see only GroupNameN, and Name_N are varibles, the rest of the fields are static. note that there is opening and closing quota for column "E" and "F" in output.xls
I have lot of data in Excel 2010 which I wish to bring in Columns using a Macro depending on the input value which the macro should prompt me. For E.g.:
If I select data from A1 and J1 (in practical it will be more Columns) the Macro should prompt me how many Columns would be the output on Master Sheet. If the input is 2 then it should create an output Sheet "Master" and should show the following result
It after selection I run the macro and input 3 then the output should go in three columns (A1,B1,C1) one below other. If 4 is Input then 4 Columns (A1,B1,C1,D1) will come below each other so on and so forth.
Column A | Column B | Column C Los Angeles | Fire Dept | 3 Los Angeles | Health Services | 12 New York | Fire Dept | 8 New York | Health Services | 22 New York | Internal Services | 100 New York | Public Works | 7 Chicago | Health Services | 15 Chicago | Public Works | 56 Chicago | Social Services | 4
And I am trying to make it look like this:
Fire Dept Health Services Internal Services Public Works Social Services
i have a problem in copying many columns to to rows that originally contains data, this is gonna be really complicated so here is wt i want, let's assume i have this table .....
I have a spreadsheet of 1000 rows on my spreadsheet and I am trying to convert them to 2 columns. Below is an example
Antidiarrheal AgentsBrand or SeriesApplicationGeneric Drug NameStrengthTypeDosage FormContainer TypeVolume Antidyskinetics Brand or SeriesApplicationGeneric Drug NameStrengthTypeDosage FormContainer TypeVolume
I want it to look like this:
Antidiarrheal Agents Brand or Series Antidiarrheal Agents Application Antidiarrheal Agents Generic Drug Name Antidiarrheal Agents Strength Antidiarrheal Agents Type Antidiarrheal Agents Dosage Form Antidiarrheal Agents Container Type Antidiarrheal Agents Volume Antidyskinetics Brand or Series Antidyskinetics Application Antidyskinetics Generic Drug Name Antidyskinetics Strength Antidyskinetics Type Antidyskinetics Dosage Form Antidyskinetics Container Type Antidyskinetics Volume
Is there a formula or a suggested way of doing a macro to acheive this?
firstly I did txt to columns, then I found some data changed to scientific format which is not I wanted as I could not convert it using function HEX2DEC.
I have a spreadsheet that consists of columns of data and I need to covert it into rows depending on how the data is set up. In column A, there is a list of invoice numbers. Columns B, C, & D are as follows:
Column B: Sales Rep Name Column C: Sales Rep Number Column D: Sales Rep % Split
I want to have a single row for each unique invoice number. As an example, I have the following:
I have a .txt file which i need to convert using text to columns in excel, obviously this is simple, however my .txt file is 325000+ rows of data
Is there anyway I can Excel can cope with this amount of data, I know that my row limitation is 65536, can i spread the data across multiple sheet tabs?
I have data which is in rows. I want them to be in 5 columns.
I am attaching the sample.
for some of the entries, there will be 6 rows: Company Name - 2nd row Address - 3 row. In this case, I want to combile them as one entry Separated by a comma & placed in one column Eg: For 3rd one in sample,
Haifa Marble & Tile 69 Garfield St Wanted Result: Haifa Marble & Tile, 69 Garfield St
If this is not possible, then suggest how to combine two columns to make it into one column separated by comma.
I have a 45 page spreadsheet with over 3500 contacts and the data is currently listed in individual cells as seen below:
John Smith Director of Business Travel Sales ABC Hotel 1200 Market St. Philadelphia, PA 19107 Phone (215) 555-1234 Fax (215) 555-4321 jsmith@abchotels.com www.abchotels.com
I want to convert the each item [data] above into separate columns so I can then save it as a CSV file and then export th data into an email list; but I have no idea how do to this.
I have a software package that requires serial number effectively data to be entered in a particular format.
As this can cover hundreds of lines I would like to make it less tedious to enter, and as my MACRO knowledge is very basic.
The data starts off in format below in example 1. After the data is CUT from the .html or .pdf document and PASTE into EXCEL. I would like the MACRO to start by pressing an activate button within EXCEL,
The serial numbers always have four digits with single serial numbers being separated by spaces and ranges being separated by a hyphen with the odd carriage return depending on how many numbers there are.
I would like the data to end up in two separate columns as shown in example 2.
Example 1 (Starting format) * indicates space - indicates a range, this needs to be separated into two separate columns
I have two columns containing dates (Date1 and Date2). Date1 is like a long date and Date 2 is a short date. I need a macro to compare these two dates and delete rows where Date1 <> Date2. Please find attached the before and after file which also contains the date formats for these two dates.
I have checked to see if this has been answered before and can not find an exact reply. My problem is that I have a combined column of address: Suburb, State, Postcode - which needs to be broken into three which not be done accurately using tet to column or fx - left mid or right. The issue is that the Suburb could be made up of one or two Words with a space between. So I can not separate using text to columns as in some cases the suburbs comprised of two words will put the second word in the "state" column. It can also not be done using Left, Right,Mid, as they number of characters differs in each line. example problem with columns to text.jpg