Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-07-2011, 12:02 AM
Catalin.B Catalin.B is offline Arranging Into Groups Windows Vista Arranging Into Groups Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

you can try this method, but it was easier if you uploaded a sample to see how is data organised... the same code is in test workbook attached..




Code:
Sub createGroups()
'first, we will sort all worksheets
Dim wks As Worksheet, i As Integer
For Each wks In ThisWorkbook.Worksheets
wks.Activate
  ActiveSheet.Sort.SortFields.Clear
  ActiveSheet.Sort.SortFields.Add Key:=Range("C1:C51"), _
  SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
    With ActiveSheet.Sort
        .SetRange Range("B1:C51")
        .Header = xlGuess
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    With ActiveSheet
 For i = 1 To 8
 .Cells(i, "F").Value = "Group " & i
 .Cells(i, 7).Value = .Cells(i, "B").Value
 .Cells(i, 8).Value = .Cells(i + 8, "B").Value
 .Cells(i, 9).Value = .Cells(i + 16, "B").Value
 .Cells(i, 10).Value = .Cells(i + 24, "B").Value
 .Cells(i, 11).Value = .Cells(i + 32, "B").Value
 .Cells(i, 12).Value = .Cells(i + 40, "B").Value
Next i
End With
    
    Next wks


End Sub
Attached Files
File Type: xlsm create groups.xlsm (21.0 KB, 12 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replys to large groups get stuck in outbox Outlook 2007 Guy ABS Broadcast Outlook 0 08-05-2011 02:05 AM
Outlook 2010 Contact Groups pmokover Outlook 0 05-21-2011 09:57 AM
Groups of folders in Outlook 2010 balubeto Outlook 1 01-06-2011 08:09 AM
Moving Sigs and Groups from OE6 to Outlook 2007 Latif Outlook 0 10-11-2010 10:23 AM
Some contacts are listed in groups I don't want ironwoods Outlook 0 07-29-2010 04:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft