Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I found it - in case someone else needs it: Sub MoveUniqueNamesHorizontally() Dim X As Long Dim Z As Long Dim UniqueNames As String UniqueNames = "*" Z = 1 With Worksheets("Sheet1") For X = 1 To .Cells(.Rows.Count, "A").End(xlUp).Row If InStr(UniqueNames, "*" & .Cells(X, "A").Value & "*") = 0 Then UniqueNames = UniqueNames & .Cells(X, "A").Value & "*" Worksheets("Sheet2").Cells(1, Z).Value = .Cells(X, "A").Value Z = Z + 1 End If Next End With End Sub Sub MoveUniqueNamesVertically() Dim X As Long Dim Z As Long Dim UniqueNames As String UniqueNames = "*" Z = 1 With Worksheets("Sheet1") For X = 1 To .Cells(.Rows.Count, "A").End(xlUp).Row If InStr(UniqueNames, "*" & .Cells(X, "A").Value & "*") = 0 Then UniqueNames = UniqueNames & .Cells(X, "A").Value & "*" Worksheets("Sheet2").Cells(Z, "A").Value = .Cells(X, "A").Value Z = Z + 1 End If Next End With End Sub Many thanks Rick. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Pivot Tables: Alternative to PivotSelect? | Excel Programming | |||
Alternative way to change data in Pivot Table | Excel Programming | |||
Macro as alternative to limitations of data table... | Excel Programming | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |