Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Debra
 
Posts: n/a
Default move contents of column C based on criteria related to column A

After exporting a MSProject gantt chart into excel, I need to move/copy
contents of column c (Task) into columns to the right based on Outline Level
in column A. Example: Outline Level=1 in column D/L1, Outline Level=2 in
column E/L2. I wrote an IF statement to do this but the text copied into the
L1-8 columns cuts off because the columns are not very wide and there are
formulas in each.

"Outline
Level" ID Task L1 L2 L3 L4 L5 L6 L7 L8
1 1078 Test
2 3487 Input
3 8873 IT work
4 8737 Enhance
5 3483 Train
6 7483 Review
7 8473 Reallocate
8 7483 Finished

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default move contents of column C based on criteria related to column A

Can't you just widen the columns?

If you can put formulas in D2 to K2, you can try this:

In D2:
=if($a2=column()-3,$c2,"")
and drag across to column K

Then select D2:K2 and drag down as far as you need.



Debra wrote:

After exporting a MSProject gantt chart into excel, I need to move/copy
contents of column c (Task) into columns to the right based on Outline Level
in column A. Example: Outline Level=1 in column D/L1, Outline Level=2 in
column E/L2. I wrote an IF statement to do this but the text copied into the
L1-8 columns cuts off because the columns are not very wide and there are
formulas in each.

"Outline
Level" ID Task L1 L2 L3 L4 L5 L6 L7 L8
1 1078 Test
2 3487 Input
3 8873 IT work
4 8737 Enhance
5 3483 Train
6 7483 Review
7 8473 Reallocate
8 7483 Finished


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Debra
 
Posts: n/a
Default move contents of column C based on criteria related to column

We have been manually sorting by Outline Level and cutting and pasting 1's in
col D, 2's in col E, etc. By moving the data the text in a cell "lays over"
the empty cells. This keeps the spreadsheet a manageable size. I think I
need a macro similar to the one shown below, except it should move column C
based on the number specified in col A (Outline Level) which is 1-8.
Sub test()
Dim from_cells_count As Long
Dim i As Long
Dim row_num As Long
Dim col_num As Long

from_cells_count = (Range("A" & Rows.Count).End(xlUp).Row)
For i = 1 To from_cells_count
If Int(i / 7) < i / 7 Then
row_num = Int(i / 7) + 1
col_num = (i Mod 7) + 1
Else
row_num = i / 7
col_num = 8
End If
Cells(row_num, col_num) = Range("A" & i)
Next i
End Sub



"Dave Peterson" wrote:

Can't you just widen the columns?

If you can put formulas in D2 to K2, you can try this:

In D2:
=if($a2=column()-3,$c2,"")
and drag across to column K

Then select D2:K2 and drag down as far as you need.



Debra wrote:

After exporting a MSProject gantt chart into excel, I need to move/copy
contents of column c (Task) into columns to the right based on Outline Level
in column A. Example: Outline Level=1 in column D/L1, Outline Level=2 in
column E/L2. I wrote an IF statement to do this but the text copied into the
L1-8 columns cuts off because the columns are not very wide and there are
formulas in each.

"Outline
Level" ID Task L1 L2 L3 L4 L5 L6 L7 L8
1 1078 Test
2 3487 Input
3 8873 IT work
4 8737 Enhance
5 3483 Train
6 7483 Review
7 8473 Reallocate
8 7483 Finished


--

Dave Peterson

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
Locate max value of one column based on criteria in another colum JDay01 Excel Worksheet Functions 2 September 1st 05 06:47 PM
Move column to in-between existing columns Melissa Excel Discussion (Misc queries) 3 August 31st 05 01:43 PM
Counting & Summing based on criteria on another column Chicago D Excel Discussion (Misc queries) 2 August 25th 05 06:58 PM
Identify the contents of column in a filtered range Jeff Excel Worksheet Functions 6 June 26th 05 11:25 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


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