A
April
I have data in one tab (Status Log Data) and want to move a row of data into
a formatted template (shell). I then want to copy the shell tab, rename the
tab and move to the next row (on the Status Log Data) and repeat.
The code below works except that it does not move to the next row and
repeat. It repeats using the same row of data from Status Log Data which
causes an error since you can not have the tab name two times. I would
appreciate any help.
Public Sub ProcStatusLogData()
Dim RowCount As Integer
Application.ScreenUpdating = False
Sheets("Shell").Select
Range("b2:b4").Select
Selection.ClearContents
Range("a6:e6").Select
Selection.ClearContents
Range("a9:i14").Select
Selection.ClearContents
For i = 1 To Rows.Count
Sheets("Status Log Data").Select
Worksheets("Shell").Cells(3, 2).Value = Worksheets("Status Log
Data").Cells(2, 1).Value
Worksheets("Shell").Cells(2, 2).Value = Worksheets("Status Log
Data").Cells(2, 2).Value
Worksheets("Shell").Cells(6, 4).Value = Worksheets("Status Log
Data").Cells(2, 3).Value
Worksheets("Shell").Cells(6, 1).Value = Worksheets("Status Log
Data").Cells(2, 4).Value
Worksheets("Shell").Cells(9, 1).Value = Worksheets("Status Log
Data").Cells(2, 5).Value
Worksheets("Shell").Cells(9, 2).Value = Worksheets("Status Log
Data").Cells(2, 6).Value
Worksheets("Shell").Cells(9, 7).Value = Worksheets("Status Log
Data").Cells(2, 7).Value
Worksheets("Shell").Cells(9, 7).Value = Worksheets("Status Log
Data").Cells(2, 8).Value
Worksheets("Shell").Cells(9, 8).Value = Worksheets("Status Log
Data").Cells(2, 9).Value
Worksheets("Shell").Cells(4, 2).Value = Worksheets("Status Log
Data").Cells(2, 10).Value
Worksheets("Shell").Cells(6, 3).Value = Worksheets("Status Log
Data").Cells(2, 11).Value
Worksheets("Shell").Cells(6, 5).Value = Worksheets("Status Log
Data").Cells(2, 12).Value
Worksheets("Shell").Cells(9, 3).Value = Worksheets("Status Log
Data").Cells(2, 13).Value
Sheets("Shell").Select
Sheets("Shell").Copy After:=Sheets(4)
Sheets("Shell (2)").Select
ActiveSheet.Name = Worksheets("Shell").Cells(2, 2).Value
Range("D37").Select
ActiveWindow.SmallScroll Down:=-18
Range("A1:I1").Select
RowCount = RowCount + 1
Next i
End Sub
a formatted template (shell). I then want to copy the shell tab, rename the
tab and move to the next row (on the Status Log Data) and repeat.
The code below works except that it does not move to the next row and
repeat. It repeats using the same row of data from Status Log Data which
causes an error since you can not have the tab name two times. I would
appreciate any help.
Public Sub ProcStatusLogData()
Dim RowCount As Integer
Application.ScreenUpdating = False
Sheets("Shell").Select
Range("b2:b4").Select
Selection.ClearContents
Range("a6:e6").Select
Selection.ClearContents
Range("a9:i14").Select
Selection.ClearContents
For i = 1 To Rows.Count
Sheets("Status Log Data").Select
Worksheets("Shell").Cells(3, 2).Value = Worksheets("Status Log
Data").Cells(2, 1).Value
Worksheets("Shell").Cells(2, 2).Value = Worksheets("Status Log
Data").Cells(2, 2).Value
Worksheets("Shell").Cells(6, 4).Value = Worksheets("Status Log
Data").Cells(2, 3).Value
Worksheets("Shell").Cells(6, 1).Value = Worksheets("Status Log
Data").Cells(2, 4).Value
Worksheets("Shell").Cells(9, 1).Value = Worksheets("Status Log
Data").Cells(2, 5).Value
Worksheets("Shell").Cells(9, 2).Value = Worksheets("Status Log
Data").Cells(2, 6).Value
Worksheets("Shell").Cells(9, 7).Value = Worksheets("Status Log
Data").Cells(2, 7).Value
Worksheets("Shell").Cells(9, 7).Value = Worksheets("Status Log
Data").Cells(2, 8).Value
Worksheets("Shell").Cells(9, 8).Value = Worksheets("Status Log
Data").Cells(2, 9).Value
Worksheets("Shell").Cells(4, 2).Value = Worksheets("Status Log
Data").Cells(2, 10).Value
Worksheets("Shell").Cells(6, 3).Value = Worksheets("Status Log
Data").Cells(2, 11).Value
Worksheets("Shell").Cells(6, 5).Value = Worksheets("Status Log
Data").Cells(2, 12).Value
Worksheets("Shell").Cells(9, 3).Value = Worksheets("Status Log
Data").Cells(2, 13).Value
Sheets("Shell").Select
Sheets("Shell").Copy After:=Sheets(4)
Sheets("Shell (2)").Select
ActiveSheet.Name = Worksheets("Shell").Cells(2, 2).Value
Range("D37").Select
ActiveWindow.SmallScroll Down:=-18
Range("A1:I1").Select
RowCount = RowCount + 1
Next i
End Sub