Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to copy some text in columns and rest in rows
Hi I have an excel table that has water quality data for numerous sites in
about a dozen columns eg. pH, salinity, turbidity , to put it in a database I need to cut and paste it so that for each of these parameters, the site name, code and date/time is in the same row. Eg. Now it is: Site Code Date/Time pH Turbidity Salinity I would like: Site Code Date/Time pH Site Code Date/Time Turbidity Site Code Date/Time Salinity Any help would be very much appreciated. Thanks. Cheers, Greg |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to copy some text in columns and rest in rows
Sub DBprep() Worksheets(1).Select j = 1 For i = 2 To 4 Worksheets(1).Select s = Cells(i, 1).Text c = Cells(i, 2).Value d = Cells(i, 3).Value p = Cells(i, 4).Value t = Cells(i, 5).Value s2 = Cells(i, 6).Value Worksheets(2).Select j = j + 1 Cells(j, 1).Value = s Cells(j, 2).Value = c Cells(j, 3).Value = d Cells(j, 4).Value = p j = j + 1 Cells(j, 1).Value = s Cells(j, 2).Value = c Cells(j, 3).Value = d Cells(j, 4).Value = t j = j + 1 Cells(j, 1).Value = s Cells(j, 2).Value = c Cells(j, 3).Value = d Cells(j, 4).Value = s2 Next End Sub -- raypayette ------------------------------------------------------------------------ raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569 View this thread: http://www.excelforum.com/showthread...hreadid=573651 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to copy some text in columns and rest in rows
Thanks heaps,
that's worked a treat I think. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Separate cell text FirstnameLastname into two columns | Excel Discussion (Misc queries) | |||
Separate cell text FirstnameLastname into two columns | Excel Discussion (Misc queries) | |||
Copy Text Only | Excel Worksheet Functions | |||
special type of rows to columns procedure | New Users to Excel | |||
Change rows to columns and vise versa | New Users to Excel |