Excel VBA質問箱 IV

当質問箱は、有志のボランティア精神のおかげで成り立っています。
問題が解決したら、必ずお礼をしましょうね。
本サイトの基本方針をまとめました。こちら をご一読ください。

投稿種別の選択が必要です。ご注意ください。
迷惑投稿防止のため、URLの入力を制限しています。ご了承ください。


41925 / 76735 ←次へ | 前へ→

【39884】Re:CSVファイルを読み込むやり方(ソース)
質問  エクセルホーリー  - 06/7/3(月) 15:50 -

引用なし
パスワード
   '*************************************************************************
'  ("E8:AF8") と ("E23:AF23")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      If count2 = 1 Then
        Range(Cells(8 + 31 * (count1 - 1), "E"), Cells(8 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(23 + 31 * (count1 - 1), "E"), Cells(23 + 31 * (count1 - 1), "AF")).Select
      End If

      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With
'*************************************************************************
'  ("E9:AF9") と ("E24:AF24")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      If count2 = 1 Then
        Range(Cells(9 + 31 * (count1 - 1), "E"), Cells(9 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(24 + 31 * (count1 - 1), "E"), Cells(24 + 31 * (count1 - 1), "AF")).Select
      End If
      
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With
'*************************************************************************
'  ("E10:AF10") と ("E25:AF25")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      ActiveWindow.SmallScroll Down:=3
      If count2 = 1 Then
        Range(Cells(10 + 31 * (count1 - 1), "E"), Cells(10 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(25 + 31 * (count1 - 1), "E"), Cells(25 + 31 * (count1 - 1), "AF")).Select
      End If

      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With
'*************************************************************************'  ("E11:AF11") と ("E26:AF26")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      If count2 = 1 Then
        Range(Cells(11 + 31 * (count1 - 1), "E"), Cells(11 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(26 + 31 * (count1 - 1), "E"), Cells(26 + 31 * (count1 - 1), "AF")).Select
      End If
      
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With
'*************************************************************************
'  ("E12:AF12") と ("E27:AF27")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      If count2 = 1 Then
        Range(Cells(12 + 31 * (count1 - 1), "E"), Cells(12 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(27 + 31 * (count1 - 1), "E"), Cells(27 + 31 * (count1 - 1), "AF")).Select
      End If
      
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With
'*************************************************************************
'  ("E13:AF13") と ("E28:AF28")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      If count2 = 1 Then
        Range(Cells(13 + 31 * (count1 - 1), "E"), Cells(13 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(28 + 31 * (count1 - 1), "E"), Cells(28 + 31 * (count1 - 1), "AF")).Select
      End If
      
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With
'*************************************************************************
'  ("E14:AF14") と ("E29:AF29")
'*************************************************************************
      Selection.Borders(xlInsideVertical).LineStyle = xlNone
      If count2 = 1 Then
        Range(Cells(14 + 31 * (count1 - 1), "E"), Cells(14 + 31 * (count1 - 1), "AF")).Select
      Else
        Range(Cells(29 + 31 * (count1 - 1), "E"), Cells(29 + 31 * (count1 - 1), "AF")).Select
      End If
      
      Selection.Borders(xlDiagonalDown).LineStyle = xlNone
      Selection.Borders(xlDiagonalUp).LineStyle = xlNone
      With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .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 = xlThin
        .ColorIndex = xlAutomatic
      End With

0 hits

【39882】CSVファイルを読み込むやり方 エクセルホーリー 06/7/3(月) 15:42 質問
【39883】Re:CSVファイルを読み込むやり方(ソース) エクセルホーリー 06/7/3(月) 15:48 質問
【39884】Re:CSVファイルを読み込むやり方(ソース) エクセルホーリー 06/7/3(月) 15:50 質問
【39885】Re:CSVファイルを読み込むやり方(ソース) エクセルホーリー 06/7/3(月) 15:51 質問
【39886】Re:CSVファイルを読み込むやり方(ソース) エクセルホーリー 06/7/3(月) 15:51 質問
【39900】Re:CSVファイルを読み込むやり方(ソース... 漂流民 06/7/4(火) 1:18 発言
【39907】Re:CSVファイルを読み込むやり方(ソース... エクセルホーリー 06/7/4(火) 9:22 質問
【39911】Re:CSVファイルを読み込むやり方(ソース... neptune 06/7/4(火) 9:40 回答
【39912】Re:CSVファイルを読み込むやり方(ソース... エクセルホーリー 06/7/4(火) 10:21 お礼

41925 / 76735 ←次へ | 前へ→
ページ:  ┃  記事番号:
2610219
(SS)C-BOARD v3.8 is Free