473,394 Members | 2,031 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,394 software developers and data experts.

Transpose columns

I have the following data, in a single column:

C1.1
5.76E-10
Undeveloped
No
O/C

C10
1.49E-9
Basic
No
S/C

C10.1
1.49E-9
Undeveloped
No
O/C. Sin efecto.

I want to transpose it to columns, in the following way:

C1.1 5.76E-10 Undeveloped No O/C
C10 1.49E-9 Basic No S/C
C10.1 1.49E-9 Undeveloped No O/C. Sin efecto.

That is, C1.1, C10, and C10.1 in one column, the numbers in the column next to it, Undeveloped, Basic, Undeveloped in the column next to it, etc.

I thought of the following:

- Start at the first cell in the column
- Cut the first 5 cells and place them in a row (transpose)
- When you hit a blank row, cut the cells below it and place them underneath the first row that was transposed.

I'm new to visual basic, and I don't know how to implement it. Thanks
Oct 19 '10 #1
4 1940
danp129
323 Expert 256MB
It sounds like you are using Excel. I would first recommend learning to record macros and editing them. While recording a macro, try to use your keyboard as much as possible. Use CTRL+SHIFT+ARROW and SHIFT+ARROW for selecting. Use CTRL+ARROW for navigating when possible.

Post what you come up with if you have any issues.
Oct 19 '10 #2
Hello, and thanks. Yes I'm using Excel. I know how to write some basic macros using VB code, but I need a macro which transposes cell contents. Similar to the "Paste Special" option in Excel, selecting "Transpose".

Right now I've only gotten code to copy a range of cells to another area of the spreadsheet. But I need them to be transposed horizontally.
Expand|Select|Wrap|Line Numbers
  1. ' Select the Range To Copy
  2.   ' Range("A6:A10").Select
  3.   ' Selection.Copy
  4.  
  5.    'Put it in Range to Paste
  6.    ' Range("C6:C10").Select
  7.    ' ActiveSheet.Paste
  8.  
Oct 19 '10 #3
Guido Geurs
767 Expert 512MB
Run the macro "Transpose" in the attachment.
If You want help with the implementation of the macro on Your data, please attach in Bytes a sheet with Your data (or a part of it if the file is to big) and an example how You want the end result.(XLS files must be ZIPPED !)
Attached Files
File Type: zip Transpose columns_v1.zip (7.5 KB, 91 views)
Oct 19 '10 #4
danp129
323 Expert 256MB
Start recording a macro and record the Paste Special/Transpose so you know how to write it.

IMO the best way to get started writing Excel macros is by recording your actions and looking at the generated code.
Oct 19 '10 #5

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

Similar topics

2
by: Howard William | last post by:
Help. I am a bit flummoxed by the problem of how to transpose "normalized" (in the database sense) data records into columns of for a data entry form, and then back again when the user is...
7
by: sangeetha | last post by:
Hi, i need to transpose a nx1 matrix to 1xn matrix inorder to multiply with nxn matrix in c language ... can anyone help in this coding ..the nx1 matrix is pi the data type is double *pi..this is...
1
by: Chris Smith | last post by:
Experience Posters, Sorry if this is not the right group to post this question. He is my issue; Is there a way without the use of 3rd party controls, to transpose the rows of a datatable to...
7
by: Leszek Gruszka | last post by:
I wrote an aplication that write something into tableA in sql2000. I want to write the same, but transposed into tableB. Someone can help me? Any example? *** Sent via Developersdex...
0
by: shantanu | last post by:
I am trying to convert a macro code to c# that will copy the values of a column and paste to anather through paste special. Everything is working fine but the transpose meathod to paste the column...
3
by: gozo74 | last post by:
Hello please i have some problem. how can i tranpose ? with SQlserver2005 ,or sql ,or script or,T-SQL for example column(f,a1,a2,a3) f a1 a2 a3 1 1 4 6 2 4 6 5 .........
0
by: Roy | last post by:
Hi All, I have a requirement where I have to read the data in a text file.This has several rows and columns.I want to transpose data from columns into rows. For example,I have data as \ ...
5
by: jenniferhelen | last post by:
I have been searching threads for a while and found the instructions listed below many times, however when I get to step 6 and select to save, I always receive the following error, "The information...
12
by: jenniferhelen | last post by:
I am working with a query that has 6 columns and 101 rows; I would like to transpose the rows and columns. I have tried using a crosstab query but Access limits the row "fields" to 3 and this was...
8
by: omar999 | last post by:
i can a max value of a single column with where clause like this select MAX(Price_Band_1) AS HighestPrice from UK_Specials where ID IN (1,3,5,7,9,10,13,15,17,19,21,23,25,27,29,31,33,35,37) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.