Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 331
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 331
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Separate cell text FirstnameLastname into two columns drewannie Excel Discussion (Misc queries) 3 July 6th 06 07:37 PM
Separate cell text FirstnameLastname into two columns drewannie Excel Discussion (Misc queries) 0 July 5th 06 09:09 PM
Copy Text Only Paul Moles Excel Worksheet Functions 0 July 23rd 05 09:27 AM
special type of rows to columns procedure cretesupplies New Users to Excel 3 June 3rd 05 06:28 PM
Change rows to columns and vise versa Ian Johnson New Users to Excel 2 March 4th 05 02:24 AM


All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"