mmaxsim.ucoz.ua
[ Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Форум » Общий » Всяко разно » excel vba
excel vba
MaxsДата: Понедельник, 24.12.2012, 12:05 | Сообщение # 1
Admin
Группа: Администраторы
Сообщений: 76
Репутация: 0
Статус: Offline
все ПРОПИСНЫЕ БУКВЫ ( на кнопку)

Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Integer
For i = 1 To 23
For j = 1 To 23
Cells(i, j) = UCase(Cells(i, j))
Next j
Next i

End Sub
 
MaxsДата: Понедельник, 24.12.2012, 15:01 | Сообщение # 2
Admin
Группа: Администраторы
Сообщений: 76
Репутация: 0
Статус: Offline
покраска ячеек по содержимому
Private Sub CommandButton1_Click()

Dim i As Integer
Dim j As Integer
For i = 3 To 25
For j = 2 To 45
If Cells(i, j) = "1" Then Cells(i, j).Interior.Color = RGB(255, 0, 0)
If Cells(i, j) = "2" Then Cells(i, j).Interior.Color = RGB(255, 165, 0)
If Cells(i, j) = "3" Then Cells(i, j).Interior.Color = RGB(255, 255, 0)
If Cells(i, j) = "4" Then Cells(i, j).Interior.Color = RGB(0, 255, 0)
If Cells(i, j) = "5" Then Cells(i, j).Interior.Color = RGB(0, 204, 255)
If Cells(i, j) = "6" Then Cells(i, j).Interior.Color = RGB(0, 0, 255)
If Cells(i, j) = "6" Then Cells(i, j).Font.Color = RGB(255, 255, 255)
If Cells(i, j) = "7" Then Cells(i, j).Interior.Color = RGB(128, 0, 128)
If Cells(i, j) = "8" Then Cells(i, j).Interior.Color = RGB(153, 51, 0)
If Cells(i, j) = "9" Then Cells(i, j).Interior.Color = RGB(255, 0, 255)
If Cells(i, j) = "10" Then Cells(i, j).Interior.Color = RGB(255, 153, 0)
If Cells(i, j) = "11" Then Cells(i, j).Interior.Color = RGB(153, 204, 0)
If Cells(i, j) = "12" Then Cells(i, j).Interior.Color = RGB(128, 128, 0)
If Cells(i, j) = "13" Then Cells(i, j).Interior.Color = RGB(0, 128, 0)
If Cells(i, j) = "14" Then Cells(i, j).Interior.Color = RGB(0, 128, 128)
If Cells(i, j) = "15" Then Cells(i, j).Interior.Color = RGB(153, 51, 102)
If Cells(i, j) = "16" Then Cells(i, j).Interior.Color = RGB(51, 51, 153)
If Cells(i, j) = "16" Then Cells(i, j).Font.Color = RGB(255, 255, 255)
If Cells(i, j) = "17" Then Cells(i, j).Interior.Color = RGB(121, 121, 121)
If Cells(i, j) = "17" Then Cells(i, j).Font.Color = RGB(255, 255, 255)
If Cells(i, j) = "18" Then Cells(i, j).Interior.Color = RGB(0, 0, 0)
If Cells(i, j) = "18" Then Cells(i, j).Font.Color = RGB(255, 255, 255)
Next j
Next i

For i = 2 To 22 Step 3
For j = 2 To 45
Cells(i, j).Interior.Color = RGB(192, 192, 192)
Next j
Next i

End Sub
 
Форум » Общий » Всяко разно » excel vba
  • Страница 1 из 1
  • 1
Поиск:

Copyright MyCorp © 2024