Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default table reordering & consolidating

can there is any function in excel modify table a to table b plz suggest.

table a table b
no dept no dept
1 a 1 a,c,d
1 c -------- 2 e,f
1 d
2 e
2 f

thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default table reordering & consolidating

This requires a VBA macro.

"ITian2009" wrote:

can there is any function in excel modify table a to table b plz suggest.

table a table b
no dept no dept
1 a 1 a,c,d
1 c -------- 2 e,f
1 d
2 e
2 f

thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default table reordering & consolidating

You need a macro for that! Try this one:

Sub test()
Dim uniqnos As Range, nos As Range, currno As Range, currow As Range
Worksheets("tablea").Activate
Columns("A:A").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Selection.CurrentRegion.Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy Destination:=Worksheets("tableb").Range("A1")
Set uniqnos = Intersect(Selection, Columns("A"), Rows("2:" & Rows.Count))
uniqnos.Select
ActiveSheet.ShowAllData
Columns("A:A").Select
Selection.AutoFilter
For Each nos In uniqnos
Selection.AutoFilter Field:=1, Criteria1:=nos.Value
Set currno = ActiveSheet.AutoFilter.Range.Columns(1)
Set currno = currno.Offset(1, 0).Resize(currno.Rows.Count - 1)
Set currno = currno.SpecialCells(xlCellTypeVisible)
deptvalue = ""
For Each currow In currno
deptvalue = deptvalue & Range("B" & currow.Row) & ","
Next currow
deptvalue = Left(deptvalue, Len(deptvalue) - 1)
currnopos = WorksheetFunction.Match(nos,
Worksheets("tableb").Columns("A"), 0)
Worksheets("tableb").Range("B" & currnopos).Value = deptvalue
Next nos
End Sub


You must have a sheet named "tablea" and another one named "tableb" before
you run the macro!

Regards,
Stefi

€˛ITian2009€¯ ezt Ć*rta:

can there is any function in excel modify table a to table b plz suggest.

table a table b
no dept no dept
1 a 1 a,c,d
1 c -------- 2 e,f
1 d
2 e
2 f

thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default table reordering & consolidating

You don't need a macro for that.
Excel 2007, Pivot Table, formulas
http://www.mediafire.com/file/macmnzdefrz/Concat2.xlsx
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default table reordering & consolidating

Thanks, I'll keep it in mind when upgrading to Excel2007.
Stefi


€˛Herbert Seidenberg€¯ ezt Ć*rta:

You don't need a macro for that.
Excel 2007, Pivot Table, formulas
http://www.mediafire.com/file/macmnzdefrz/Concat2.xlsx

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
Pivot Table Field Reordering Josh Johansen Excel Discussion (Misc queries) 4 June 19th 07 01:55 PM
Pivot Table field reordering Josh Johansen Excel Discussion (Misc queries) 0 June 19th 07 01:52 PM
consolidating worksheets into a table jourdan 1 Excel Discussion (Misc queries) 4 May 4th 07 09:23 PM
Pivot Table - consolidating because Excel Discussion (Misc queries) 1 February 9th 07 08:03 PM
Pivot Table - consolidating ranges (again) xman Excel Discussion (Misc queries) 3 September 18th 05 02:17 PM


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