Auto Populating new sheets

Big_Cat

New Member
Joined
May 21, 2015
Messages
1
I'm trying to figure out how to populate Sheet 2 (Item 1) with the information from Sheet 1 (Submittals log) Row 6 automatically. I'd like a new sheet created for each item in Column A with the same format as the Sheet 2, but with the information for the next Row down (Item 2) and I'd like the sheet to take the name of the "Work Item" (Column D).

[TABLE="class: grid, width: 800, align: center"]
<tbody>[TR]
[TD]Item NO:[/TD]
[TD]Sub Item[/TD]
[TD]Spec Section[/TD]
[TD]Work Item[/TD]
[TD]Manufacturer[/TD]
[TD]Product Description[/TD]
[TD]Date Submitted[/TD]
[TD]Date Approved[/TD]
[TD]Days Outstanding[/TD]
[TD]Comments[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1a[/TD]
[TD]02 74 10[/TD]
[TD]Hot Mix Asphalt[/TD]
[TD][/TD]
[TD]Asphalt Mix Design[/TD]
[TD]5/21/15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2a[/TD]
[TD]03 13 00[/TD]
[TD]Ready Mix Design[/TD]
[TD][/TD]
[TD]Concrete Ready mix[/TD]
[TD]5/21/15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2b[/TD]
[TD]03 13 00[/TD]
[TD]Daravair[/TD]
[TD][/TD]
[TD]Air Entrainment admixture[/TD]
[TD]5/21/15[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD]05 31 00[/TD]
[TD]Metal Decking[/TD]
[TD]Vulcraft[/TD]
[TD]1.5VLR[/TD]
[TD]5/21/15[/TD]
[TD][/TD]
[TD][/TD]
[TD]Engineer to choose style[/TD]
[/TR]
</tbody>[/TABLE]

Sheet 2
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Product No:[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sub Product No:[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Spec Section[/TD]
[TD]02 74 10[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Product Name[/TD]
[TD]Hot Mix Asphalt[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Manufacturer[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Product Description[/TD]
[TD]Asphalt Mix Design[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Date Submitted[/TD]
[TD]5/21/2015[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Approval[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Comments[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Sheet 3 would auto populate with information from Row 3 "Item 2"

Any ideas, I know basic excel, but not enough to figure this out myself.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Here is a macro that will do just that. Take a look.

Rich (BB code):
Option Explicit


Public Sub PopulateNewSheets()
  ' name of the source sheet
  Const sSOURCE_SHEET As String = "Sheet 1"
  
  ' to determine the entire range
  Dim rngTopLeft As Excel.Range
  Dim rngBottomLeft As Excel.Range
  Dim rngTopRight As Excel.Range
  
  ' to select entire source range as well as header column
  Dim rngSource As Excel.Range
  Dim rngSourceHeader As Excel.Range
  
  ' to select each individual row
  Dim rngSourceRecord As Excel.Range
  
  ' object variables to manipulate the sheets
  Dim wshSource As Excel.Worksheet
  Dim wshDest As Excel.Worksheet
  
  ' temporary helper variables
  Dim sName As String
  Dim i As Long
  Dim bContinue As Boolean
  
  ' set source sheet
  Set wshSource = ThisWorkbook.Worksheets(sSOURCE_SHEET)
  
  ' define the dimensions of the source
  Set rngTopLeft = wshSource.Range("A1")
  Set rngBottomLeft = rngTopLeft.End(xlDown)
  Set rngTopRight = rngTopLeft.End(xlToRight)
  
  Set rngSource = wshSource.Range(rngTopLeft, Intersect(rngBottomLeft.EntireRow, rngTopRight.EntireColumn))
  Set rngSourceHeader = wshSource.Range(rngTopLeft, rngTopRight)
  
  ' loop through each row of data
  ' create a new sheet
  ' if one already exists, replace it
  For i = 2 To rngSource.Rows.Count
    Set rngSourceRecord = rngSource.Rows(i)
    sName = rngSourceRecord.Cells(1, 4).Value
    On Error Resume Next
      Set wshDest = ThisWorkbook.Worksheets(sName)
    On Error GoTo 0
    If wshDest Is Nothing Then
      Set wshDest = ThisWorkbook.Worksheets.Add
      On Error Resume Next
        wshDest.Name = sName
        bContinue = True
        If Err.Number <> 0 Then
          bContinue = False
          Call MsgBox("Work Item " & sName & " is not a valid worksheet name")
        End If
      On Error GoTo 0
      
    Else
      bContinue = True
      wshDest.Cells.Clear
    End If
    
    If bContinue Then
      rngSourceHeader.Copy
      wshDest.Cells(1, 1).PasteSpecial Paste:=xlPasteAll, Transpose:=True


      rngSourceRecord.Copy
      wshDest.Cells(1, 2).PasteSpecial Paste:=xlPasteAll, Transpose:=True
      
      wshDest.UsedRange.EntireColumn.AutoFit
    End If
    bContinue = False
    Set wshDest = Nothing
  Next i
  
  Application.CutCopyMode = False
  
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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