Friday, October 27, 2017

Animation Of The Colors With Excel Vba Codes



        Excel animation with voice and music prepared with VBA codes to learn colors (spanish).

When clicked on the color circles, the animation of clicked color starts A 3D cylinder was selected as the animation item.At the end of the animation, the name of the color is played and a child laughing effect is played using playing function. Spanish colours were used as example colors in the template.

 The function that generates moving :
Sub basla()
 m = 0
    For i = 1 To 90
      Selection.ShapeRange.ThreeD.RotationY = m
      m = m - 1
    DoEvents
    Next i
        For i = 1 To 180
      Selection.ShapeRange.ThreeD.RotationY = m
      m = m + 1
      DoEvents
    Next i
        For i = 1 To 90
      Selection.ShapeRange.ThreeD.RotationY = m
      m = m - 1
      DoEvents
    Next i
        For i = 1 To 90
      Selection.ShapeRange.ThreeD.RotationX = m
      m = m - 1
      DoEvents
    Next i
       For i = 1 To 180
      Selection.ShapeRange.ThreeD.RotationX = m
      m = m + 1
      DoEvents
    Next i
        For i = 1 To 90
      Selection.ShapeRange.ThreeD.RotationX = m
      m = m - 1
      DoEvents
    Next i
    End Sub


Tuesday, October 17, 2017

Excel Vba: Dictionary (Catalog) Form



        It can be used as an application such as dictionary, index.
For example, we entered the names of the vitamins to column A and entered descriptions of vitamins to column B.
The data in column A of the page is filled to the combobox on the userform.

The value corresponding to the item selected from the combobox is fetched from the column B and displayed on label under the combobox.

The used codes to increase the width of the UserForm:
Private Sub CommandButton4_Click()
Dim X, d, yuk As Integer
If CommandButton4.Caption = "8" And Data_Form.Width = 410 Then
For d = 1 To 158
DoEvents
yuk = 410
Data_Form.Width = yuk - d
Next
ComboBoxTopics.Enabled = True
ComboBoxTopics.ListIndex = 0
CommandButton4.Caption = "9"
Exit Sub
End If
If CommandButton4.Caption = "9" And Data_Form.Width = 252 Then
For X = 1 To 158
DoEvents
yuk = 252
Data_Form.Width = yuk + X
Next
ComboBoxTopics.Enabled = False
CommandButton4.Caption = "8"
End If
End Sub