Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default rows to columns and colums to rows

Hi,

I am New to excel programing in VB,
I want to know the code how to change the row to colume and colume to
row

and can i can i know where i learn online for programing for excel.



for eg if i have :
abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1 2 3
xyz 2 3 5
hgf 3 4 3


and


when i have something like this


abc 1 2 3
xyz 2 3 5
hgf 3 4 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


hope you have understood what i ment...


like vice versa


Thank you in advance


Regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default rows to columns and colums to rows

You can try Copy, and Paste Special and click the Transpose checkbox. This
may not work for your situation though.

To find VBA Programming Resources online, I would just Google VBA Tutorials
or VBA Programming, etc. You should get lots of resources.

Hope this helps.

Keith

"Bravo" wrote:

Hi,

I am New to excel programing in VB,
I want to know the code how to change the row to colume and colume to
row

and can i can i know where i learn online for programing for excel.



for eg if i have :
abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1 2 3
xyz 2 3 5
hgf 3 4 3


and


when i have something like this


abc 1 2 3
xyz 2 3 5
hgf 3 4 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


hope you have understood what i ment...


like vice versa


Thank you in advance


Regards


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default rows to columns and colums to rows

Hello,

I've written something similar to what you want, I'll try to get the
code for you shortly.

--JP


"Bravo" wrote:
Hi,


I am New to excel programing in VB,
I want to know the code how to change the row to colume and colume to
row


and can i can i know where i learn online for programing for excel.


for eg if i have :
abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1 2 3
xyz 2 3 5
hgf 3 4 3


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default rows to columns and colums to rows

Bravo--

You might try the web sites of Gary Radley and Martin Green for VBA
training. There web sites a

http://www.users.bigpond.net.au/grad...tor/index.html

http://www.fontstuff.com/vba/index.htm

Steve G

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default rows to columns and colums to rows

On Oct 5, 2:12 am, JP wrote:
Hello,

I've written something similar to what you want, I'll try to get the
code for you shortly.

--JP



"Bravo" wrote:
Hi,


I am New to excel programing in VB,
I want to know the code how to change the row to colume and colume to
row


and can i can i know where i learn online for programing for excel.


for eg if i have :
abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1 2 3
xyz 2 3 5
hgf 3 4 3- Hide quoted text -


- Show quoted text -


JP

can you please share the code with me



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default rows to columns and colums to rows

Some time ago, I had the same question on the rows to columns on reference
(your 2nd scenario). Here was the response I received unfortunately I don't
remember from whom. I did change it a bit to create a new sheet but this
should work provided your data is within column A:K if not change the range
to match your case.

Public Sub ProcessData2()
Dim cColumns As Long
Dim i As Long
Dim iLastRow As Long
Dim iLastCol As Long
Dim cMaxCols As Long
Dim cell As Range
Dim sh As Worksheet

Columns("A:K").Select
Columns("A:K").Copy
Sheets.Add
Range("A1").Select
ActiveSheet.Paste

With ActiveSheet

cColumns = .Cells(1, .Columns.Count).End(xlToLeft).Column
iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If .Cells(i, "A").Value = .Cells(i - 1, "A").Value Then
iLastCol = .Cells(i, .Columns.Count) _
..End(xlToLeft).Column
..Cells(i, "B").Resize(1, iLastCol - 1).Copy .Cells(i - 1, cColumns + 1)
If iLastCol + cColumns cMaxCols Then _
cMaxCols = iLastCol + cColumns - 1
..Rows(i).Delete
End If
Next i

'now add headings
For i = cColumns + 1 To cMaxCols Step cColumns - 1
..Range("B1").Resize(, cColumns - 1).Copy .Cells(1, i)
Next i

End With

MsgBox "Run Complete"

End Sub

Now I have the same question as your 1st scenario (columns to rows).

"Bravo" wrote:

On Oct 5, 2:12 am, JP wrote:
Hello,

I've written something similar to what you want, I'll try to get the
code for you shortly.

--JP



"Bravo" wrote:
Hi,


I am New to excel programing in VB,
I want to know the code how to change the row to colume and colume to
row


and can i can i know where i learn online for programing for excel.


for eg if i have :
abc 1
abc 2
abc 3


xyz 2
xyz 3
xyz 5


hgf 3
hgf 4
hgf 3


and i have a button call CHANGE


when i click on the button CHANGE


abc 1 2 3
xyz 2 3 5
hgf 3 4 3- Hide quoted text -


- Show quoted text -


JP

can you please share the code with me


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
rows and colums lizfox Excel Discussion (Misc queries) 2 November 20th 09 07:04 PM
How do change rows to colums AND columns to rows Colleen A Excel Discussion (Misc queries) 7 December 30th 05 12:40 AM
Print few rows with many colums so that rows wrap on printed pages usfgradstudent31 Excel Discussion (Misc queries) 1 October 20th 05 02:39 PM
colums and rows ... Star Excel Worksheet Functions 1 February 3rd 05 01:31 AM
How do I name the colums and rows? Cin3 New Users to Excel 5 January 5th 05 11:09 PM


All times are GMT +1. The time now is 02:03 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"