Solved

Separate items into a different row in Excel

Posted on 2016-08-19
13
66 Views
Last Modified: 2016-08-23
Hello EE

Can someone assist me with this please , I need to be able to separate the items in Column B into a separate Row .
Current outputThis is what I need
0
Comment
Question by:MilesLogan
  • 4
  • 3
  • 3
  • +2
13 Comments
 
LVL 15

Expert Comment

by:WalkaboutTigger
ID: 41763274
It is a 2-step process.
The first step involves converting the multi line cell to multiple columns.  This is done in native Excel and can be recorded as a macro.
Select column B
From the ribbon, select Data
From the Data menu, select Text to Columns
From the Text to Columns Wizard, select Delimited then select Next.
At Step 2 of the Wizard, uncheck all options and select Other.
In the box next to Other hold the Alt key down and type 0010.
Select Next on Step 2.
At Step 3 of the Wizard, in the Destination field, enter =$D$1 and select Finish.
Now you should have each item in column B in columns D through as many columns as are needed on the same line as the machine name.

If you record this as a macro, you can see how this is performed programmatically.
For a reference to the function, please review this link on the Microsoft MSDN site.
0
 
LVL 15

Expert Comment

by:WalkaboutTigger
ID: 41763278
Or, if this is being generated via Powershell, post your script (use the CODE link and paste your script into the code block) and we might be able to change the script to provide you with exactly what you want rather than gathering the data in one place and massaging it into shape in another.
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 41763343
How about a sample file for testing? I do not wish to type this.
0
 
LVL 11

Expert Comment

by:Wilder1626
ID: 41763848
Another option could be to use the pivot table option. You can do do easily.
Pivot table no1

Here is a sample in attachment
Pivot-Table_no1.xlsx
0
 
LVL 15

Expert Comment

by:WalkaboutTigger
ID: 41763920
I believe you're using Powershell to read AD.

Likely something along the lines of

Get-ADPrincipalGroupMembership (Get-ADComputer [b]MachineName1[/b]).DistinguishedName

Open in new window

and piping it out to a CSV.

Have you tried something like this, where AllComputers.TXT is a list of the computers whose membership you want to identify.

Import-Module ActiveDirectory
Get-Content C:\Scripts\AllComputers.txt | Get-ADComputer $_ -Properties memberOf |
Select-Object -Property @{N= "Name";E= {$_.samaccountname}},@{N= "Groups";E={$_.Memberof}} |
export-csv -path C:\Data\AllComputers_results.csv -append

Open in new window

0
 
LVL 2

Author Comment

by:MilesLogan
ID: 41764471
HI WalkabouTigger when I pull the data via Powershell it is in the correct format but it takes much longer to get . This data is being generated from IBM BigFix and apparently this is the only way they can get me the data .

So I cant do this option below .
Other hold the Alt key down and type 0010.

When I press the ALT key and I try to enter 0010 it beeps , does not allow me to enter them.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 2

Author Comment

by:MilesLogan
ID: 41764477
HI Wilder1626

Can you show me how you did that ?
0
 
LVL 28

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41764493
Please try this....

Click the button on Test Sheet in the attached to run the code to get the data in the desired format.
If you have an issue downloading and opening the file due to a temporary bug in the forum, first download and save it on your system and then open it.

Sub TransformData()
Dim lr As Long, i As Long
Dim str() As String

Application.ScreenUpdating = False
lr = Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 2 Step -1
   str() = Split(Cells(i, 2), Chr(10))
   If UBound(str) > 0 Then
      Cells(i + 1, 1).Resize(UBound(str)).EntireRow.Insert
      Cells(i, 2).Resize(UBound(str) + 1).Value = Application.Transpose(str)
   End If
Next i
lr = Cells(Rows.Count, 2).End(xlUp).Row
Range("A2:A" & lr).SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
Application.ScreenUpdating = True
End Sub

Open in new window

SeparateItems.xlsm
0
 
LVL 11

Expert Comment

by:Wilder1626
ID: 41764504
MilesLogan

See this small video that will show you how to do this.

Let us know if you have any questions.
Pivot-table-No1.zip
0
 
LVL 2

Author Closing Comment

by:MilesLogan
ID: 41767026
Hi Sudohn , this worked perfect .. thank you so much
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41767032
You're welcome MilesLogan! Glad to help.
0
 
LVL 15

Expert Comment

by:WalkaboutTigger
ID: 41767271
Nice solution, Subodh.

Having dealt with BigFix in the past, you have my sincerest sympathies, Miles.
0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41767290
@WalkaboutTigger
Thanks for the appreciation. :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Set OWA language and time zone in Exchange for individuals, all users or per database.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now