Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate columns in one column one after one


In selection.range, multiple columns are selected.

Upon execution, I need this all columns to be populated in one colum
one after one.

For example please see attached file.
FYI, Selection area= Green color cell, Output area=Yellow color cel

+-------------------------------------------------------------------
|Filename: Col-2-Row.zip
|Download: http://www.excelforum.com/attachment.php?postid=3734
+-------------------------------------------------------------------

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=39858

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Populate columns in one column one after one

ilyaskazi,

Explain your needs with words - very few people will open your file.

HTH,
Bernie
MS Excel MVP


"ilyaskazi" wrote in message
...

In selection.range, multiple columns are selected.

Upon execution, I need this all columns to be populated in one column
one after one.

For example please see attached file.
FYI, Selection area= Green color cell, Output area=Yellow color cell


+-------------------------------------------------------------------+
|Filename: Col-2-Row.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3734 |
+-------------------------------------------------------------------+

--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=398583



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate columns in one column one after one


The only thing i need is to populate all the data of selected multipl
columns in single one column.
Data of column-C, D, E if selected, then populate its data in column-
with first column-C, D and then E.

Kindly requesting you all to see picture file attached, if possible.
m unable to explain more on this issue with words

+-------------------------------------------------------------------
|Filename: Col-2-Row.JPG
|Download: http://www.excelforum.com/attachment.php?postid=3742
+-------------------------------------------------------------------

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=39858

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate columns in one column one after one


Maybe you'll get some ideas from this:

Sub CopyColumnByColumn()
'You should change [ActiveSheet.Range("C1:F7")] to you
selected range
Dim NumColumns As Integer
NumColumns
ActiveSheet.Range("C1:F7").Columns.Count

Dim NumRows As Long
NumRows = ActiveSheet.Range("C1:F7").Rows.Count

Dim ColIndex As Integer
Dim RowIndex As Long
RowIndex = 1 'start at first row

For ColIndex = 1 To NumColumns
ActiveSheet.Range("C1:F7").Columns(ColIndex).Cop
Cells(RowIndex, 1)
RowIndex = RowIndex + NumRows
Next ColIndex
End Sub

hope this helps... :)

ilyaskazi Wrote:
The only thing i need is to populate all the data of selected multipl
columns in single one column.
Data of column-C, D, E if selected, then populate its data in column-
with first column-C, D and then E.

Kindly requesting you all to see picture file attached, if possible.
m unable to explain more on this issue with words


--
T-®e
-----------------------------------------------------------------------
T-®ex's Profile: http://www.excelforum.com/member.php...fo&userid=2657
View this thread: http://www.excelforum.com/showthread.php?threadid=39858

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate columns in one column one after one


Excellent !!!

It is working exactly as wanted for copying column by column

Thankyou T-®ex...

I was trying hard to apply same with copying row by row but fail to do
so.
Can u help me again plz..


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=398583



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate columns in one column one after one


Try the following:


Code
-------------------
'copies the contents of a selection, column by column, to column 'A'
'starting at row 1
Sub CopyColumnByColumn()
Dim SelectedTarget As Range
Dim NumColumns As Integer
Dim NumRows As Long
Dim ColIndex As Integer
Dim RowIndex As Long
Dim ColLocation As Integer

Set SelectedTarget = Selection
NumColumns = SelectedTarget.Columns.Count
NumRows = SelectedTarget.Rows.Count
RowIndex = 1 'start at first row
ColLocation = 1 'copy to column 'A'

For ColIndex = 1 To NumColumns
SelectedTarget.Columns(ColIndex).Copy Cells(RowIndex, ColLocation)
RowIndex = RowIndex + NumRows
Next ColIndex
End Sub

'copies the contents of a selection, row by row, to row 1
'starting at column 'A'
Sub CopyRowByRow()
Dim SelectedTarget As Range
Dim NumColumns As Integer
Dim NumRows As Long
Dim ColIndex As Integer
Dim RowIndex As Long
Dim RowLocation As Long

Set SelectedTarget = Selection
NumColumns = SelectedTarget.Columns.Count
NumRows = SelectedTarget.Rows.Count
ColIndex = 1 'start at first column
RowLocation = 1 'copy to row 1

For RowIndex = 1 To NumRows
SelectedTarget.Rows(RowIndex).Copy Cells(RowLocation, ColIndex)
ColIndex = ColIndex + NumColumns
Next RowIndex
End Sub

'copies the contents of a selection, row by row, to column 'A'
'starting at row 1
Sub CopyRowByRowToColumn()
Dim SelectedTarget As Range
Dim NumColumns As Integer
Dim NumRows As Long
Dim ColIndex As Integer
Dim RowIndex As Long
Dim ColLocation As Integer
Dim CurrentRow As Long

Set SelectedTarget = Selection
NumColumns = SelectedTarget.Columns.Count
NumRows = SelectedTarget.Rows.Count
ColLocation = 1 'copy to column 'A'
CurrentRow = 1 'start at row 1

For RowIndex = 1 To NumRows
For ColIndex = 1 To NumColumns
Cells(CurrentRow, ColLocation).Value = SelectedTarget.Cells(RowIndex, ColIndex).Value
CurrentRow = CurrentRow + 1
Next ColIndex
Next RowIndex
End Su
-------------------


To use, run these codes against a selection, i.e., select some cell
and run the code... :)

ilyaskazi Wrote:
Excellent !!!

It is working exactly as wanted for copying column by column

Thankyou T-®ex...

I was trying hard to apply same with copying row by row but fail to d
so.
Can u help me again plz.


--
T-®e
-----------------------------------------------------------------------
T-®ex's Profile: http://www.excelforum.com/member.php...fo&userid=2657
View this thread: http://www.excelforum.com/showthread.php?threadid=39858

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate columns in one column one after one


Great Job Mr T-®ex.

Thankyou for your time and help

--
ilyaskaz
-----------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...fo&userid=2396
View this thread: http://www.excelforum.com/showthread.php?threadid=39858

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
Can I get criteria from columns to populate down? Charles Stover[_2_] Excel Discussion (Misc queries) 4 March 7th 09 09:16 PM
Vlookup? populate 3 columns of data when match a common value, UMPhy Tom Excel Worksheet Functions 1 March 13th 08 07:26 PM
Populate multiple columns nick Excel Worksheet Functions 0 October 10th 05 06:42 PM
Populate a column by extracting unique values from another column? Mike Palmer Excel Worksheet Functions 2 June 10th 05 03:21 PM
Populate 2-column ListBox with 2 non-contiguous columns Paul Martin Excel Programming 2 December 8th 04 01:45 AM


All times are GMT +1. The time now is 01:44 AM.

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"