Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Rowwise data into columnwise data

HI,

I have following data which is rowwise

CLIENT_DEMAT A/C ISIN QUANTITY
13448047 INE245C01019 268
13448047 INE271B01025 63
13448047 INE703B01027 178
13448047 INE703B01027 137
13451500 INE090A01013 13
13451500 INE245C01019 12
13448055 INE090B01013 23
13448055 INE245D01019 32

Since the first four demat account number is same, the other colums should
repeat on same row and then in second row next account number should appear
and so on so forth..
I would like to have the above data rearranged as under;

CLIENT_DEMAT A/C ISIN QUANTITY ISIN QUANTITY ISIN QUANTITY ISIN QUANTITY
13448047 INE245C01019 268 INE271B01025 63 INE703B01027 178 INE703B01027 137
13451500 INE090A01013 13 INE245C01019 12
13448055 INE090B01013 23 INE245D01019 32

(data is not shown correctly the same needs to be copied to notepad)

How to write a program in VBA to arrive at this, please help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Rowwise data into columnwise data

Sub CombineClients()

RowCount = 2
NewCol = 4
Do While Range("A" & RowCount) < ""
If Range("A" & RowCount) = Range("A" & (RowCount + 1)) Then
ISIN = Range("B" & (RowCount + 1))
QUANTITY = Range("C" & (RowCount + 1))
Cells(RowCount, NewCol) = ISIN
Cells(RowCount, NewCol + 1) = QUANTITY
If Cells(1, NewCol) = "" Then
Cells(1, NewCol) = "A/C ISIN"
Cells(1, NewCol + 1) = "QUANTITY"
End If
Rows(RowCount + 1).Delete
NewCol = NewCol + 2
Else
NewCol = 4
RowCount = RowCount + 1
End If
Loop

End Sub


"Vijay Kotian" wrote:

HI,

I have following data which is rowwise

CLIENT_DEMAT A/C ISIN QUANTITY
13448047 INE245C01019 268
13448047 INE271B01025 63
13448047 INE703B01027 178
13448047 INE703B01027 137
13451500 INE090A01013 13
13451500 INE245C01019 12
13448055 INE090B01013 23
13448055 INE245D01019 32

Since the first four demat account number is same, the other colums should
repeat on same row and then in second row next account number should appear
and so on so forth..
I would like to have the above data rearranged as under;

CLIENT_DEMAT A/C ISIN QUANTITY ISIN QUANTITY ISIN QUANTITY ISIN QUANTITY
13448047 INE245C01019 268 INE271B01025 63 INE703B01027 178 INE703B01027 137
13451500 INE090A01013 13 INE245C01019 12
13448055 INE090B01013 23 INE245D01019 32

(data is not shown correctly the same needs to be copied to notepad)

How to write a program in VBA to arrive at this, please help

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
I need a formula for rowwise Excel function Excel Worksheet Functions 2 April 15th 08 10:35 AM
Conversion from columnwise to rowwise Frank Situmorang Excel Programming 6 September 14th 07 11:00 AM
rowwise query Gerald Excel Worksheet Functions 2 October 14th 06 01:00 PM
How to sort the data entered in different columns (columnwise) Viswanathan Balaji Excel Worksheet Functions 2 July 20th 06 03:44 PM
rowwise total! via135 Excel Worksheet Functions 6 March 30th 06 07:56 PM


All times are GMT +1. The time now is 11:42 PM.

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

About Us

"It's about Microsoft Excel"