Row to Column + Data

gzell

New Member
Joined
Apr 20, 2019
Messages
37
In the worksheet Column G is data Designation and Column H is data that goes with Column G. on each row. I need help in converting first 12 rows for each individual in column G to columns on new worksheet. The original rows have a Data_ID that corresponds with Data in Column G and H, not sure if this would help in the conversion.. Step one would include the rows with Data_ID 1_1, 1_2, 1_3, 1_4, 1_5, 1_6, 1_7, 1_8, 1_9, 1_10, 1_11, 1_12, (Column G) these would be moved to another worksheet and transposed to columns. Column H would then be moved to the new worksheet and the data entry would be placed on rows below the correct Column in step one.

Worksheet has 1145 Soldiers and with 27486 rows of data.

Current worksheet
A B C D E F G H
Row_ID
Person_ID​
Last NameFirst NameMiddleData_IDResearch DataIndividual Information
1
21
Able​
Ezekiel​
1_1
Army​
Confederacy
311_2
Location​
Texas
411_3
Regiment​
10th Regiment Texas Infantry (Nelson's)
511_4
Function​
Infantry
611_5
Company​
C
711_6
Rank​
Private
811_7
Age​
--
911_8
Residence​
--
1011_9
Enrolled​
Buchanan, Johnson County, Texas
1111_10
Date​
October 16, 1861
1211_11
Enlisted​
Houston, Texas
1311_12
Date​
October 25, 1861
1412_1
Detail​
Hospital Nurse
1512_1
Detail​
November 8, 1862
1613_1
Relieved of Duty​
Nurse
1713_1
Date​
February 4, 1862
1814_1
Captured​
Battle of Arkansas Post
1914_1
Date​
January 11, 1863
2014_2
Forwarded​
St. Louis, Missouri via Boats
2114_3
Forwarded​
Camp Douglas, Illinois via Rail
2214_4
Prisoner​
Camp Douglas, Illinois
2314_5
Died​
March 7, 1863
2414_5
Cause​
Small Pox
25
262
Adams​
John​
H​
1_1
Army​
Confederacy
2721_2
Location​
Texas
2821_3
Regiment​
10th Regiment Texas Infantry (Nelson's)
2921_4
Function​
Infantry
3021_5
Company​
I
3121_6
Rank​
Corporal
3221_7
Age​
42
3321_8
Residence​
Johnson County, Texas
3421_9
Enlisted​
Kimball Texas or Millican, Texas
3521_10
Date​
January 16, 1862
3622_1
Captured​
Battle Arkansas Post, Arkansas
3722_1
Date​
January 11, 1863
3822_1
Forwarded​
St. Louis, Missouri via Boats
3922_1
Forwarded​
Camp Douglas, Illinois via Rail
4022_1
Prisoner​
Camp Douglas, Illinois
4122_1
Forwarded for Exchange​
City Point, Virginia
4222_1
Date​
April 10, 1863
4322_10
Hospital​
Sick
4422_10
Location​
Kingston, Georgia
4522_10
Date​
March 22, 1864
4622_1
Captured​
Franklin, Tennessee
4722_1
Date​
November 30, 1864
4822_1
Forwarded​
Nashville, Tennessee
4922_1
Forwarded​
Louisville, Kentucky
5022_1
Arrived​
December 3 1864
5122_1
Forwarded​
Camp Douglas, Illinois
5222_1
Date​
December 3, 1863
5322_1
Arrived​
December 6, 1863
54213_1
Discharged​
Per G.O. No. 109, A.G.O.
55213_1
Date​
June 18, 1865

New Worksheet would look like this

Row_IDPerson_ID
Last_Name​
First_Name​
Middle_Name​
Army​
Location​
Regiment​
Function​
Company
Rank​
Age
Residence​
Enrolled​
Date​
Enlisted​
Date​
21
Able​
Ezekiel​
ConfederacyTexas10th Regiment Texas Infantry (Nelson's)InfantryCPrivate----Buchanan, Johnson County, TexasOctober 16, 1861Houston, TexasOctober 25, 1861
32
Adams​
John​
H​
Confederacy​
Texas​
10th Regiment Texas Infantry (Nelson's)​
Infantry​
I
Corporal​
42
Johnson County, Texas​
--​
--​
Kimball Texas or Millican, Texas​
January 16, 1862​
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about
VBA Code:
Sub gzell()
   Dim Ar As Areas
   Dim i As Long
   
   Set Ar = Sheets("Sheet1").Range("C:C").SpecialCells(xlConstants).Areas
   With Sheets.Add
      .Name = "New"
      .Range("A1:E1").Value = Ar(1).Offset(, -2).Resize(, 5).Value
      .Range("F1:Q1").Value = Application.Transpose(Ar(2).Offset(, 4).Resize(12).Value)
      For i = 2 To Ar.Count
         With .Range("A" & Rows.Count).End(xlUp).Offset(1)
            .Value = i
            .Offset(, 1).Resize(, 4).Value = Ar(i).Offset(, -1).Resize(, 4).Value
            .Offset(, 5).Resize(, 12).Value = Application.Transpose(Ar(i).Offset(, 5).Resize(12).Value)
         End With
      Next i
   End With
End Sub
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
Thanks again for the help. The last step I would like to do the same action for the remainder rows for each soldier. There are more entries and not all are the same, because it is specific information for actions during the Civil War. It would be similar to the steps above, create new worksheet, called "Individual Data" and move data under each column as needed. As you can see from example in original thread, it is the rows below the 1_1-1_12. for each individual. Do I need to identify the number of columns that will be created on new work sheet or can it be done with an open ended statement on the number of new columns? If I need to open a new thread I will be glad to do that.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top