A列からE列までに文字を追加します。(セル1〜5)
Sub 特定のセルに文字を追加() Dim N, T As Integer Dim buf, Head As String T = 51 For T = 1 To 5 If T = 1 Then Head = "大:" ElseIf T = 2 Then Head = "小:" ElseIf T = 3 Then Head = "サブ1:" ElseIf T = 4 Then Head = "サブ2:" ElseIf T = 5 Then Head = "サブ3:" End If For N = 2 To 525 'MsgBox (Cells(N, T)) If Str(Cells(N, T)) = "0" Then 'MsgBox (Str(N) + "/" + Str(T)) ElseIf Cells(N, T) = 0 Then Else Cells(N, T) = Head + Str(Cells(N, T)) End If Next Next End Sub
コメントする