PC Review


Reply
Thread Tools Rate Thread

Column List to Multiple Columns

 
 
tstirling@franklinfoundation.org
Guest
Posts: n/a
 
      8th Jan 2008
I am using Microsoft Excel 2007. I have an account number in C:2.
Associated with this account number is a set (in a column) of 3 digit
numbers in W:2, W:3, W:4, W:5. When there are multiple 3 digit numbers
in Column W, there are blank spaces under C:2. When the next account
number appears (C:6), it has it's own set of 3 digit numbers. I need
to take each 3 digit number associated with the account number and
move them into adjacent columns on the same line as the account
number. So, W:3 would move to X:2, W:4 would move to Y:2, W:5 would
move to Z:2 and so on. I assume I need a VB solution. Can anyone help
me with this? Thank you very much in advance.
 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      8th Jan 2008
Sub Macro1()
'assumes target sheet is ActiveSheet
'assumes data starts in row 1
'works in Excel 2002
Dim iCt As Integer
Dim iRow As Integer

iCt = 2
iRow = 1
iCol = 24
Do
If Range("C" & iCt) = "" Then
Cells(iRow, iCol) = Range("W" & iCt)
Range("W" & iCt).Clear
iCol = iCol + 1
Else
iCol = 24
iRow = iCt
End If
iCt = iCt + 1
Loop Until Range("W" & iCt) = ""
End Sub

Hth,
Merjet

 
Reply With Quote
 
TStirling
Guest
Posts: n/a
 
      8th Jan 2008
On Jan 8, 11:20*am, merjet <mer...@comcast.net> wrote:
> Sub Macro1()
> 'assumes target sheet is ActiveSheet
> 'assumes data starts in row 1
> 'works in Excel 2002
> Dim iCt As Integer
> Dim iRow As Integer
>
> iCt = 2
> iRow = 1
> iCol = 24
> Do
> * * If Range("C" & iCt) = "" Then
> * * * * Cells(iRow, iCol) = Range("W" & iCt)
> * * * * Range("W" & iCt).Clear
> * * * * iCol = iCol + 1
> * * Else
> * * * * iCol = 24
> * * * * iRow = iCt
> * * End If
> * * iCt = iCt + 1
> Loop Until Range("W" & iCt) = ""
> End Sub
>
> Hth,
> Merjet


What changes to the code have to be made if the data begins on Row 2?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Column List to Multiple Columns TStirling Microsoft Excel Worksheet Functions 5 8th Jan 2008 08:35 PM
Column List to Multiple Columns TStirling Microsoft Excel Discussion 1 8th Jan 2008 05:19 PM
Column List to Multiple Columns TStirling Microsoft Excel Misc 0 8th Jan 2008 04:28 PM
move list of numbers from one column to multiple columns =?Utf-8?B?Y29hY2ggZW8=?= Microsoft Excel Misc 12 16th Feb 2006 08:12 PM
Change a Column list into multiple rows & columns angelface Microsoft Excel Worksheet Functions 3 28th Jan 2006 01:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 AM.