Attribute VB_Name = "Module1" Option Explicit Sub naver_to_tistory() Dim end_Row As Integer, i As Integer Dim id_start_loc As Integer, id_end_loc As Integer, div_start_loc As Integer, image_start_loc As Integer Dim div_span_start_loc As Integer, div_span_end_loc As Integer end_Row = Range("a10000").End(xlUp).Row For i = end_Row To 1 Step -1 div_start_loc = InStr(Range("a" & i), "div") image_start_loc = InStr(Range("a" & i), "Image") div_span_start_loc = InStr(Range("a" & i), "div>") div_span_end_loc = InStr(Range("a" & i), "/span>") If image_start_loc > 0 Then Range("a" & i) = WorksheetFunction.Substitute(Range("a" & i), "div", "p") ElseIf div_start_loc > 0 Then Rows(i).Delete shift:=xlUp End If Next End Sub Sub make_table2() 'º¯¼ö ¼±¾ð Dim end_Row As Integer, end_Col As Integer, i As Integer, j As Integer, k As Integer Dim start_loc As Integer, end_loc As Integer ' ¸¶Áö¸· Çà°ú ¿­À» ±¸ÇÔ end_Row = Range("a1000").End(xlUp).Row For j = 2 To 100 If InStr(Cells(end_Row, j), "") > 0 Then end_Col = j - 1 Exit For End If Next If end_Col = 0 Then end_Col = Cells(end_Row, 100).End(xlToLeft).Column End If ' ±âÁ¸ µ¥ÀÌÅÍ Áö¿ò Range(Cells(1, end_Col + 1), Cells(end_Row, 100)).ClearContents ' ù¹øÂ°·Î ±â·ÏÇÒ ¼¿¿¡ table, tbody ÀÔ·Â Cells(1, end_Col + 1) = "" '1ÇàºÎÅÍ ³¡Çà±îÁö ¹Ýº¹ ó¸® For i = 1 To end_Row '1¿­ºÎÅÍ ³¡¿­±îÁö ¹Ýº¹ ó¸® For j = 1 To end_Col ' ¼¿¿¡ µ¥ÀÌÅͰ¡ ÀÖ´Â °æ¿ì If Len(Cells(i, j)) > 0 Then Select Case j 'ù ¿­ÀÎ °æ¿ì Case 1: ' ¼¼·Î ¹æÇâ, °¡·Î ¹æÇâÀÌ ¸ðµÎ º´ÇÕµÈ °æ¿ì If Cells(i, j).MergeArea.Rows.Count > 1 And Cells(i, j).MergeArea.Columns.Count > 1 Then '±âÁ¸ °ª¿¡ ³Ö°í, " ' ¼¼·Î ¹æÇ⸸ ¼¿ º´ÇÕÀÎ °æ¿ì ElseIf Cells(i, j).MergeArea.Rows.Count > 1 Then '±âÁ¸ °ª¿¡ ³Ö°í, " ' °¡·Î ¹æÇ⸸ ¼¿ º´ÇÕÀÎ °æ¿ì ElseIf Cells(i, j).MergeArea.Columns.Count > 1 Then '±âÁ¸ °ª¿¡ ³Ö°í, " ' ¼¿ º´ÇÕÀÌ ¾Æ´Ñ °æ¿ì Else '±âÁ¸ °ª¿¡ ¿¬°áÇϰí, " End If ' ³¡ ¿­ÀÎ °æ¿ì Case end_Col: ' ³¡¿­ÀÌ º´ÇÕÀ̸鼭 °ªÀÌ ÀÖÀ» ¼ö´Â ¾øÀ¸¹Ç·Î ¼¿ º´ÇÕ Á¶°Ç ¾øÀ½ ' ±âÁ¸ °ª¿¡ °áÇÕÇϸ鼭 td ű׸¦ ¿­°í ó¸® ¼¿°ªÀ» ´õÇÑ ´ÙÀ½ tdÅÂ±×¿Í trű׸¦ ´ÝÀ½ ' 1Çຸ´Ù Å« °æ¿ì¸¸ ó¸® ¼¿ °ªÀÌ ¼ýÀÚÀÎ °æ¿ì õ ´ÜÀ§¸¶´Ù ÄÞ¸¶¸¦ ³ÖÀ½ Cells(i, end_Col + j) = Cells(i, end_Col + j) & "" ' Áß°£ ¿­ÀÎ °æ¿ì Case Else: ' ¼¼·Î ¹æÇâ, °¡·Î ¹æÇâÀÌ ¸ðµÎ º´ÇÕµÈ °æ¿ì If Cells(i, j).MergeArea.Rows.Count > 1 And Cells(i, j).MergeArea.Columns.Count > 1 Then ' ±âÁ¸ °ª¿¡ ³Ö°í, " ' ¼¼·Î ¹æÇ⸸ ¼¿ º´ÇÕÀÎ °æ¿ì ElseIf Cells(i, j).MergeArea.Rows.Count > 1 Then ' ±âÁ¸ °ª¿¡ ³Ö°í, " ' °¡·Î ¹æÇ⸸ ¼¿ º´ÇÕÀÎ °æ¿ì ElseIf Cells(i, j).MergeArea.Columns.Count > 1 Then ' ±âÁ¸ °ª¿¡ ³Ö°í, " ' ¼¿ º´ÇÕÀÌ ¾Æ´Ñ °æ¿ì Else '±âÁ¸ °ª¿¡ °áÇÕÇϸ鼭 " End If End Select '¼¿¿¡ µ¥ÀÌÅͰ¡ ¾ø´Â °æ¿ì Else Select Case j 'ù¹øÂ° ¿­ÀÎ °æ¿ì Case 1: '¼¿ º´ÇÕÀ̶ó¸é ÅÂ±× Ãß°¡ If Cells(i, j).MergeArea.Rows.Count > 1 Or Cells(i, j).MergeArea.Columns.Count > 1 Then Cells(i, end_Col + j) = "" '¼¿ º´ÇÕÀÌ ¾Æ´Ï¶ó¸é ÅÂ±× Ãß°¡ Else Cells(i, end_Col + j) = "" End If ' ³¡ ¿­ÀÎ °æ¿ì Case end_Col: '¼¿ º´ÇÕÀ̶ó¸é ÅÂ±× Ãß°¡ If Cells(i, j).MergeArea.Rows.Count > 1 Or Cells(i, j).MergeArea.Columns.Count > 1 Then Cells(i, end_Col + j) = "" '¼¿ º´ÇÕÀÌ ¾Æ´Ï¶ó¸é ÅÂ±× Ãß°¡ Else Cells(i, end_Col + j) = "" End If 'Áß°£ ¿­ÀÎ °æ¿ì Case Else: '¼¿ º´ÇÕÀÌ ¾Æ´Ï¶ó¸é ÅÂ±× Ãß°¡ If Cells(i, j).MergeArea.Rows.Count = 1 And Cells(i, j).MergeArea.Columns.Count = 1 Then Cells(i, end_Col + j) = "" End If End Select End If '°¡¿îµ¥ Á¤·Ä, ¼ýÀÚÀÎ °æ¿ì ¿À¸¥ÂÊ Á¤·Ä If Cells(i, j).HorizontalAlignment = xlCenter Then Cells(i, end_Col + j) = WorksheetFunction.Substitute(Cells(i, end_Col + j), "") end_loc = InStr(start_loc, Cells(i, end_Col + j), "<") Cells(i, end_Col + j) = WorksheetFunction.Substitute(Cells(i, end_Col + j), Mid(Cells(i, end_Col + j), start_loc + 1, end_loc - start_loc - 1), "" & Mid(Cells(i, end_Col + j), start_loc + 1, end_loc - start_loc - 1) & "") End If ' µé¿©¾²±â If Cells(i, j).IndentLevel > 0 Then start_loc = InStr(Cells(i, end_Col + j), ">") end_loc = InStr(start_loc, Cells(i, end_Col + j), "<") Dim n_nbsp As String n_nbsp = "" For k = 1 To Cells(i, j).IndentLevel n_nbsp = n_nbsp & " " Next Cells(i, end_Col + j) = WorksheetFunction.Substitute(Cells(i, end_Col + j), Mid(Cells(i, end_Col + j), start_loc + 1, end_loc - start_loc - 1), n_nbsp & Mid(Cells(i, end_Col + j), start_loc + 1, end_loc - start_loc - 1)) End If Next Next ' ¸¶Áö¸·¿¡ ´Ý´Â tbody¿Í table ÅÂ±× Ãß°¡ Cells(end_Row, end_Col + j - 1) = Cells(end_Row, end_Col + j - 1) & "
" & Cells(i, j) & "
" & Cells(i, j) & "
" & Cells(i, j) & "
ÅÂ±× ¿­¸é¼­ ó¸® ¼¿ °ªÀ» °áÇÕÇϰí td ÅÂ±× ´ÝÀ½ Cells(i, end_Col + j) = Cells(i, end_Col + j) & "
" & Cells(i, j) & "" & _ IIf(i > 1 And WorksheetFunction.IsNumber(Cells(i, j)), WorksheetFunction.Text(Cells(i, j), "#,##0"), Cells(i, j)) & "
" & _ IIf(i > 1 And WorksheetFunction.IsNumber(Cells(i, j)), WorksheetFunction.Text(Cells(i, j), "#,##0"), Cells(i, j)) & "
" & _ IIf(i > 1 And WorksheetFunction.IsNumber(Cells(i, j)), WorksheetFunction.Text(Cells(i, j), "#,##0"), Cells(i, j)) & "
" & _ IIf(i > 1 And WorksheetFunction.IsNumber(Cells(i, j)), WorksheetFunction.Text(Cells(i, j), "#,##0"), Cells(i, j)) & " ÅÂ±× ¿­¸é¼­ ó¸® ¼¿ °ªÀ» °áÇÕÇϰí td ÅÂ±× ´ÝÀ½ ' 1Çຸ´Ù Å« °æ¿ì¸¸ ó¸® ¼¿ °ªÀÌ ¼ýÀÚÀÎ °æ¿ì õ ´ÜÀ§¸¶´Ù ÄÞ¸¶¸¦ ³ÖÀ½ Cells(i, end_Col + j) = Cells(i, end_Col + j) & "" & _ IIf(i > 1 And WorksheetFunction.IsNumber(Cells(i, j)), WorksheetFunction.Text(Cells(i, j), "#,##0"), Cells(i, j)) & "
" End Sub Sub ³¯Â¥º¯È¯() Dim col_num As Range Dim prev_value As Date Dim prev_range As Range, paste_cells As Range Set col_num = Application.InputBox("³¯Â¥¸¦ º¯È¯ÇÒ ¿­À» ¼±ÅÃÇϼ¼¿ä.", Type:=8) If col_num(1, 1).End(xlDown).Row = Cells(Rows.Count, col_num.Column).End(xlUp).Row Then Set prev_range = col_num(1, 1).Offset(1, 0) Else Set prev_range = Cells(1, col_num.Column).End(xlDown).Offset(1, 0) End If If prev_range.CurrentRegion.Rows.Count = 2 Then prev_range = DateValue(prev_range) prev_range.NumberFormat = "yyyy-mm-dd" End Else prev_value = DateValue(prev_range) prev_range = 1 prev_range.Copy If prev_range.CurrentRegion.Rows.Count = 3 Then Set paste_cells = prev_range.Offset(1, 0) Else Set paste_cells = Range(prev_range.Offset(1, 0), prev_range.Offset(1, 0).End(xlDown)) End If End If paste_cells.Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply, _ SkipBlanks:=False, Transpose:=False Range(prev_range, prev_range.End(xlDown)).NumberFormat = "yyyy-mm-dd" prev_range = prev_value prev_range.Select Application.CutCopyMode = False End Sub