2016-06-19 4 views
-3

전류 출력 1 예상 출력 2 I 헤더 아래 데이터가 덮어 얻는다 코드를 변경할 때마다 . 이 매크로는 4 개의 Excel 탭을 반환합니다. 코드 여기 :분할 헤더 행 요소

Sub Import_Data() 
Dim lastrow As Long 

ThisWorkbook.Sheets(4).Select 
lastrow = ActiveSheet.Range("A2").End(xlDown).Row 


'For i = 2 To lastrow 
'ActiveSheet.Select 
'Range("C" & i).Value = Range("C" & i).Value/1000000 
'Next i 



ActiveSheet.Range("A1:B" & lastrow).Select 
Selection.Copy 

Sheets("Industry Comparables (1 of 3)").Select 
ActiveSheet.Range("A8").Select 
ActiveSheet.Paste 

Sheets("Industry Comparables (2 of 3)").Select 
ActiveSheet.Range("A7").Select 
ActiveSheet.Paste 

Sheets("Industry Comparables (3 of 3)").Select 
ActiveSheet.Range("A7").Select 
ActiveSheet.Paste 


ThisWorkbook.Sheets(4).Select 
ActiveSheet.Select 
ActiveSheet.Range("C1:O" & lastrow).Select 
Selection.Copy 

Sheets("Industry Comparables (1 of 3)").Select 
ActiveSheet.Range("C8").Select 
ActiveSheet.Paste 

Range("B8").Value = "Name" 
Range("C8").Value = "Market Cap ($ Mil.) (Most Recent Month End)" 
Range("D8").Value = "Assets to Equity (CY)" 
Range("E8").Value = "Assets to Equity (PY)" 
Range("F8").Value = "Asset Turn- over (CY)" 
Range("G8").Value = "Asset Turn- over (PY)" 
Range("H8").Value = "Sales /Inven Turn- over (CY)" 
Range("I8").Value = "Sales /Inven Turn- over (PY)" 
Range("J8").Value = "Receiv- ables Turn- over (CY)" 
Range("K8").Value = "Receiv- ables Turn- over (PY)" 
Range("L8").Value = "Current Ratio (CY)" 
Range("M8").Value = "Current Ratio (PY)" 
Range("N8").Value = "Quick Ratio (CY)" 
Range("O8").Value = "Quick Ratio (PY)" 
Range("B10:B12").Select 
Selection.ClearContents 

ThisWorkbook.Sheets(4).Select 
ActiveSheet.Select 
ActiveSheet.Range("P1:Y" & lastrow).Select 
Selection.Copy 

Sheets("Industry Comparables (2 of 3)").Select 
ActiveSheet.Range("C7").Select 
ActiveSheet.Paste 
Range("B7").Value = "Name" 
Range("C7").Value = "Total Debt% Total Assets (CY)" 
Range("D7").Value = "Total Debt% Total Assets (PY)" 
Range("E7").Value = "Total Debt% Total Equity (CY)" 
Range("F7").Value = "Total Debt% Total Equity (PY)" 
Range("G7").Value = "L T Debt% Total Capital (CY)" 
Range("H7").Value = "L T Debt% Total Capital (PY)" 
Range("I7").Value = "S T Debt% Total Debt (CY)" 
Range("J7").Value = "S T Debt% Total Debt (PY)" 
Range("K7").Value = "Net Cash Fl % Total Debt (CY)" 
Range("L7").Value = "Net Cash Fl % Total Debt (PY)" 

Range("B9:B11").Select 
Selection.ClearContents 

ThisWorkbook.Sheets(4).Select 
ActiveSheet.Select 
ActiveSheet.Range("Z1:AK" & lastrow).Select 
Selection.Copy 

Sheets("Industry Comparables (3 of 3)").Select 
ActiveSheet.Range("C7").Select 
ActiveSheet.Paste 

Range("B7").Value = "Name" 
Range("C7").Value = "Gross Income Margin (CY)" 
Range("D7").Value = "Gross Income Margin (PY)" 
Range("E7").Value = "Net Income Margin (CY)" 
Range("F7").Value = "Net Income Margin (PY)" 
Range("G7").Value = "Oper Margin (CY)" 
Range("H7").Value = "Oper Margin (PY)" 
Range("I7").Value = "Return on Avg Total Equity (CY)" 
Range("J7").Value = "Return on Avg Total Equity (PY)" 
Range("K7").Value = "Basic EPS Before Extra- ordinary Items (CY)" 
Range("L7").Value = "Basic EPS Before Extra- ordinary Items (PY)" 
Range("M7").Value = "Diluted EPS Before Extra- Ordinary Items (CY)" 
Range("N7").Value = "Diluted EPS Before Extra- Ordinary Items (PY)" 

Range("B9:B11").Select 
Selection.ClearContents 


Application.CutCopyMode = False 
'Application.DisplayAlerts = False 
'Sheets(4).Delete 
'Application.DisplayAlerts = True 


End Sub 

Sub Comp1Macro() 

    Dim lastrow As Integer 

Sheets("Industry Comparables (1 of 3)").Select 
    With ActiveWindow 
     .SplitColumn = 0 
     .SplitRow = 0 
    End With 
    ActiveWindow.FreezePanes = False 
    Range("A1").Select 
    ActiveCell.FormulaR1C1 = "GICS Industry-" & Sheets(4).Range("AN2").Value 
    With Selection.Font 
     .Name = "Arial" 
     .Size = 12 
     .Strikethrough = False 
     .Superscript = False 
     .Subscript = False 
     .OutlineFont = False 
     .Shadow = False 
     .Underline = xlUnderlineStyleNone 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Font.Bold = True 
    Range("A2").Select 
    ActiveCell.FormulaR1C1 = _ 
     "The following is an analysis of key ratios/metrics for the issuer compared to other issuers in the same industry." 
    'Rows("3:7").Select 
    'Selection.Insert Shift:=xlDown 
    Range("A3").Select 
    ActiveCell.FormulaR1C1 = _ 
     "Current Year (CY) ratios are based on each issuer's most recent fiscal year end financials." 
    Range("A4").Select 
    ActiveCell.FormulaR1C1 = _ 
     "Prior Year (PY) ratios are based on the year prior to each issuer's most recent fiscal year end financials." 
    Range("A6").Select 
    ActiveCell.FormulaR1C1 = "Note 1 - Market Cap is as of most recent month end prior to this issuer profile report date." 
    Range("A2:A4").Select 
    With Selection.Font 
     .Size = 11 
     .Strikethrough = False 
     .Superscript = False 
     .Subscript = False 
     .OutlineFont = False 
     .Shadow = False 
     .Underline = xlUnderlineStyleNone 
     .ColorIndex = xlAutomatic 
    End With 
    'Rows("8:17").Select 
    'Selection.Delete Shift:=xlUp 
    Range("A8:O8").Select 
    With Selection 
     .HorizontalAlignment = xlCenter 
     .VerticalAlignment = xlCenter 
     .WrapText = True 
     .Orientation = 0 
     .AddIndent = False 
     .IndentLevel = 0 
     .ShrinkToFit = False 
     .ReadingOrder = xlContext 
     .MergeCells = False 
    End With 
    Selection.Font.Bold = True 
    Selection.Font.ColorIndex = 2 
    With Selection.Interior 
     .ColorIndex = 9 
     .Pattern = xlSolid 
    End With 
    Rows("8:8").EntireRow.AutoFit 
    Range("A8:O8").Select 
    Selection.Font.ColorIndex = 2 
    Range("A8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone 
    Selection.Borders(xlEdgeTop).LineStyle = xlNone 
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone 
    Selection.Borders(xlEdgeRight).LineStyle = xlNone 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone 
    'Rows("9:12").Select 
    'Selection.Insert Shift:=xlDown 
    Range("A9:O9").Select 
    Selection.Interior.ColorIndex = 6 
    Range("A9:B9").Select 
    Selection.Font.Bold = True 
    Range("C9:O9").Select 
    Selection.Font.Bold = True 
    Range("A10").Select 
    Range(Selection, Selection.End(xlDown)).Select 
    Range("A10:O12").Select 
    Selection.Interior.ColorIndex = 5 
    Selection.Font.ColorIndex = 2 
    Range("A10").Select 
    ActiveCell.FormulaR1C1 = "Upper quartile of Comparables" 
    Range("A11").Select 
    ActiveCell.FormulaR1C1 = "Median of Comparables" 
    Range("A12").Select 
    ActiveCell.FormulaR1C1 = "Lower quartile of Comparables" 
    Range("A10:O12").Select 
    Selection.Font.Bold = True 
    ActiveSheet.UsedRange 
    lastrow = ActiveSheet.Range("A13").End(xlDown).Row 
    Range("A13").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("A13:O" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone 
    Selection.Borders(xlEdgeTop).LineStyle = xlNone 
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone 
    Selection.Borders(xlEdgeRight).LineStyle = xlNone 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    With Selection.Borders(xlInsideHorizontal) 
     .LineStyle = xlContinuous 
     .Weight = xlThin 
     .ColorIndex = xlAutomatic 
    End With 
    Range("B8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("C8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("C8:C" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Range("D8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("D8:E" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Range("F8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("F8:G" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Range("H8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("H8:I" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Range("J8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("J8:K" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Range("L8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("L8:M" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Range("N8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("N8:O" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Selection.Borders(xlInsideVertical).LineStyle = xlNone 
    Range("A8").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("A8:O" & lastrow).Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    Columns("A:A").Select 
    Selection.ColumnWidth = 8 
    Range("B:B").Select 
    Selection.ColumnWidth = 21 
    Range("A9:B9").Select 
    With Selection 
     .HorizontalAlignment = xlCenter 
     .VerticalAlignment = xlBottom 
     .WrapText = False 
     .Orientation = 0 
     .AddIndent = False 
     .IndentLevel = 0 
     .ShrinkToFit = False 
     .ReadingOrder = xlContext 
     .MergeCells = False 
    End With 
' Selection.Merge 
    Range("A10:B10").Select 
    With Selection 
     .HorizontalAlignment = xlCenter 
     .VerticalAlignment = xlBottom 
     .WrapText = False 
     .Orientation = 0 
     .AddIndent = False 
     .IndentLevel = 0 
     .ShrinkToFit = False 
     .ReadingOrder = xlContext 
     .MergeCells = True 
    End With 
    Selection.Merge 
    Range("A11:B11").Select 
    With Selection 
     .HorizontalAlignment = xlCenter 
     .VerticalAlignment = xlBottom 
     .WrapText = False 
     .Orientation = 0 
     .AddIndent = False 
     .IndentLevel = 0 
     .ShrinkToFit = False 
     .ReadingOrder = xlContext 
     .MergeCells = True 
    End With 
    Selection.Merge 
    Range("A12:B12").Select 
    With Selection 
     .HorizontalAlignment = xlCenter 
     .VerticalAlignment = xlBottom 
     .WrapText = False 
     .Orientation = 0 
     .AddIndent = False 
     .IndentLevel = 0 
     .ShrinkToFit = False 
     .ReadingOrder = xlContext 
     .MergeCells = True 
    End With 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("A9:O12").Select 
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone 
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone 
    With Selection.Borders(xlEdgeLeft) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeTop) 
     .LineStyle = xlContinuous 
     .Weight = xlThin 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeBottom) 
     .LineStyle = xlContinuous 
     .Weight = xlThin 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlEdgeRight) 
     .LineStyle = xlContinuous 
     .Weight = xlMedium 
     .ColorIndex = xlAutomatic 
    End With 
    With Selection.Borders(xlInsideHorizontal) 
     .LineStyle = xlContinuous 
     .Weight = xlThin 
     .ColorIndex = xlAutomatic 
    End With 
    Range("A1").Select 
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select 
    Range("A1:O" & lastrow).Select 
    ActiveSheet.PageSetup.PrintArea = "$A$1:$O$" & lastrow 
    With ActiveSheet.PageSetup 
     .PrintTitleRows = "$1:$12" 
     .PrintTitleColumns = "" 
    End With 
    ActiveSheet.PageSetup.PrintArea = "$A$1:$O$" & lastrow 
    With ActiveSheet.PageSetup 
     .LeftHeader = "" 
     .CenterHeader = "" 
     .RightHeader = "&"",Bold""&11Confidential - Not for External Distribution" 
     .LeftFooter = "&P of &N" 
     .CenterFooter = "" 
     .RightFooter = "&"",Bold""&11Comparable 1 of 3&"",Regular""&9" & Chr(10) & "" 
     .LeftMargin = Application.InchesToPoints(0.25) 
     .RightMargin = Application.InchesToPoints(0.25) 
     .TopMargin = Application.InchesToPoints(1) 
     .BottomMargin = Application.InchesToPoints(1) 
     .HeaderMargin = Application.InchesToPoints(0.5) 
     .FooterMargin = Application.InchesToPoints(0.5) 
     .PrintHeadings = False 
     .PrintGridlines = False 
     .PrintComments = xlPrintNoComments 
     .PrintQuality = 600 
     .CenterHorizontally = True 
     .CenterVertically = False 
     .Orientation = xlLandscape 
     .Draft = False 
     .PaperSize = xlPaperLetter 
     .FirstPageNumber = xlAutomatic 
     .Order = xlDownThenOver 
     .BlackAndWhite = False 
     .Zoom = 70 
     .FitToPagesWide = 1 
     .FitToPagesTall = 1 
     .PrintErrors = xlPrintErrorsDisplayed 
    End With 
    Selection.Replace What:="#N/A", Replacement:="No Data", LookAt:=xlPart, _ 
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ 
    ReplaceFormat:=False 
    ActiveCell.SpecialCells(xlLastCell).Select 
    Columns("P:P").Select 
    Selection.Delete Shift:=xlToLeft 
    Range("C9:O" & lastrow).Select 
    Selection.NumberFormat = "_(* #,##0.0_);_(* (#,##0.0);_(* ""-""?_);_(@_)" 
    Range("A9:O9").Select 
    With Selection 
     Selection.Font.ColorIndex = 1 
    End With 
Cells.Select 
    With Selection.Font 
     .Name = "Arial" 
     .Strikethrough = False 
     .Superscript = False 
     .Subscript = False 
     .OutlineFont = False 
     .Shadow = False 
     .Underline = xlUnderlineStyleNone 
     .TintAndShade = 0 
     .ThemeFont = xlThemeFontNone 
    End With 

     Range("A8:O" & lastrow).Select 
    With Selection.Font 
     .Name = "Arial" 
     .Size = 10 
     .Strikethrough = False 
     .Superscript = False 
     .Subscript = False 
     .OutlineFont = False 
     .Shadow = False 
     .Underline = xlUnderlineStyleNone 
     .TintAndShade = 0 
     .ThemeFont = xlThemeFontNone 
    End With 


End Sub 

이 매크로를 실행 한 후 출력으로 생성 된 다음 탭 (4)에 대해 유사한 부호가있다. 나는 모든 탭에 대해 동일한 결과를 원한다. 이 코드에 대한 대답이 나온다면 다른 코드도 비슷하게 조정할 수 있습니다. 고마워요

+2

코드의 관련성이없는 부분을 모두 제거하는 데 많은 도움이됩니다. –

+1

두 개의 "출력"도 동일하게 보입니다 ... –

+0

안녕하세요, 현재 및 예상 출력 이미지를 업데이트했습니다. – Karan

답변

0

필요한 변경 작업은 매우 간단하지만 솔직히 말해서 코드 재 작성이 필요합니다. 많은 사람들이 당신을 대신해서 그렇게 할 것 같지 않습니다.

Range("B7").Value = "Name" 
Range("C7").Value = "Gross Income Margin" 
Range("D7").Value = "Gross Income Margin" 
Range("E7").Value = "Net Income Margin" 
Range("F7").Value = "Net Income Margin" 
'etc 

Range("B8").Value = "" 
Range("C8").Value = "(CY)" 
Range("D8").Value = "(PY)" 
Range("E8").Value = "(CY)" 
Range("F8").Value = "(PY)" 
'etc 
+0

감사합니다. Tim, 이것은 나를 위해 일했습니다. 그러나 데이터는 덮어 씁니다. 데이터를 복사하고 붙여 넣기하는 코드는 여기에서 제공됩니다 ("Industry Comparables (1 of 3)") ActiveSheet.Range ("A8") 선택 ActiveSheet.Paste 선택 빈 행을 추가 할 수있는 방법이 있습니까? 셀 A8에있는 머리글 뒤에 A9에 빈 행이 있고 셀 A10에서 모든 데이터가 붙여집니다. - 응답을 기다리고 있습니다. 감사합니다. – Karan

+0

@tim 윌리엄스에게 감사합니다. 이것은 나를 위해 일했습니다. 그러나 데이터는 덮어 씁니다. 데이터를 복사하고 붙여 넣기하는 코드는 여기에서 제공됩니다 ("Industry Comparables (1 of 3)") ActiveSheet.Range ("A8") 선택 ActiveSheet.Paste 선택 빈 행을 추가 할 수있는 방법이 있습니까? 그 사이에 셀 A8-O8에있는 헤더 다음에 A9-O9에 빈 행이 있고 모든 데이터가 셀 A10에서 붙여 넣어집니다. 응답을 기다리십시오. 감사합니다 – Karan

+0

한 줄 아래에'ActiveSheet.Range ("A9") 붙여 넣기를 선택하십시오 : ActiveSheet.Paste' –