473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using a Loop

I have recorded a Macro on Excel 2007 to sort a column of 912 counts into its constituents. I am a VBA beginner and have tried to set up a loop. I have not succeeded over the last few days. Please could someone help?

Description:
The column exists as follows and contains 776 counts of three headers Name, Univ. Name, eMail :
Harry, Garry
My University
Harrysg1@myuniversity.edu
Next,Garry
NextMy University
NextHarrysg1@myuniversity.edu

I am trying to sort this one continuous column into three rows with the headers mentioned above ie. Name, Univ. Name, eMail

How can I modify my Macro to loop so that it covers all the 912 cells in the column and spit out the results in rows?

Sheets("Sheet2").Select
Range("A1:A3").Select
Selection.Copy
Sheets("Sheet3").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A2").Select
ActiveCell.Offset(2, 0).Select

End Sub

Thanks
Dec 4 '09 #1
3 1403
Guido Geurs
767 Expert 512MB
dear,

I think the best way is to use an array.
I have writen an macro (see attachment)
Hopefully is this a solution for your problem.
if not, please let me know.

br,
Attached Files
File Type: zip Split coll in n colls.zip (8.3 KB, 45 views)
Dec 11 '09 #2
Hi ggeu,

Thank you. That Macro worked perfectly. I appreciate your taking the time to help me.

Any recommendations on a book that I can use to get an introduction into VBA programming, that has been written for a person without a programming background?

Thanks again,


R
Dec 12 '09 #3
Guido Geurs
767 Expert 512MB
dear,

this are good free ebooks:

http://www.theopensourcery.com/index.htm
http://www.programminglearn.com/
.....

just look on the web for "free vba ebook" and you will find several websites.

br,
Dec 12 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Carlos Ribeiro | last post by:
As a side track of my latest investigations, I began to rely heavily on generators for some stuff where I would previsouly use a more conventional approach. Whenever I need to process a list, I'm...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
8
by: doomx | last post by:
I'm using SQL scripts to create and alter tables in my DB I want to know if it's possible to fill the description(like in the Create table UI) using these scripts. EX: CREATE TABLE(...
5
by: John Dumais | last post by:
Hello, I have been trying to figure out how to write an array of doubles (in this specific case) to a binary stream without using a loop. What I have been doing is... foreach(double d in...
13
by: Bev in TX | last post by:
We are using Visual Studio .NET 2003. When using that compiler, the following example code goes into an endless loop in the "while" loop when the /Og optimization option is used: #include...
9
by: George McCullen | last post by:
I have an Outlook 2003 using Exchange Server 2003 Public Contacts Folder containing 20,000 Contacts. I am writing a VB .Net 2003 program that loops through all the contacts in a "for each oCt in...
17
by: John Salerno | last post by:
I'm reading Text Processing in Python right now and I came across a comment that is helping me to see for loops in a new light. I think because I'm used to the C-style for loop where you create a...
1
by: Thiero | last post by:
Hi I posted s thread but did have any reply, I am a new programmer and really wants someone to help me on how to use TreeMap for this code cos I want to it to be able to handle the options from 6...
29
by: garyusenet | last post by:
I'm trying to investigate the maximum size of different variable types. I'm using INT as my starting variable for exploration. I know that the maximum number that the int variable can take is:...
3
by: Akira | last post by:
I noticed that using foreach is much slower than using for-loop, so I want to change our current code from foreach to for-loop. But I can't figure out how. Could someone help me please? Current...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.