Ustalarım bu konu hakkında bana yardıncı olu |
Fareyi sağ tıklamada Büyük/Küçük Harf çep olarak açlıyor (ok) |
Sub Aut |
Call SpecialCellMenu |
End Sub |
' |
Sub SpecialCellMenu() |
Dim cb As CommandBar |
Set cb = Application.CommandBars("Cell") |
' |
Set MenuObject = cb.Controls.Add(Type:=msoControlPopup, Temporary:=True) |
MenuObject.Caption = "Büyük/Küçük Harf...®" |
MenuObject.BeginGroup = True |
MenuObject.Tag = "MyTagR" |
' |
For MenuItem = 1 To 4 |
Set PopItem = MenuObject.Controls.Add(msoControlButton, 1, MenuItem, , True) |
PopItem.FaceId = 7 |
With PopItem |
Select Case MenuItem |
Case 1 |
.Caption = "ABC DEF" |
Case 2 |
.Caption = "Abc Def" |
Case 3 |
.Caption = "abc def" |
Case 4 |
.Caption = "Abc def" |
Case 5 |
.Caption = "Abc Def GHI" |
End Select |
.OnAction = "CaseChange" |
End With |
Next |
Set cb = Nothing |
Set PopItem = Nothing |
Set MenuObject = Nothing |
End Sub |
' |
Sub Auto_Close() |
Application.CommandBars("Cell").Reset |
End Sub |
' |
Sub CaseChange() |
Dim lngType As Long, MyRng As Range |
Set MyWd = CreateObject("Word.Application") |
Set MyDoc = MyWd.Documents.Add |
|
Select Case CommandBars.ActionControl.Parameter |
Case 1 |
lngType = 1 |
Case 2 |
lngType = 2 |
Case 3 |
lngType = 0 |
Case 4 |
lngType = 4 |
End Select |
|
For Each MyRng In Selection |
If (Not MyRng = Empty) And (Not IsNumeric(MyRng)) Then |
MyWd.Selection.Text = MyRng.Text |
MyWd.Selection.Range.Case = lngType |
MyRng = MyWd.Selection.Text |
End If |
Next |
|
MyDoc.Close False |
MyWd.Quit |
Set MyDoc = Nothing |
Set MyWd = Nothing |
End Sub |
Fareyi sağ tıklamada liste olarak geliyor |
Fareyi sağ tıklamada Renkler çep olarak açılmasını iştiyorum. |
Option Explicit |
Sub MENÜ() |
Dim X As Integer, Menü1 As Object, Menü2 As Object, Menü3 As Object, Menü4 As Object, Menü5 As Object |
|
Application.CommandBars("Cell").Reset |
Set Menü1 = Application.CommandBars("Cell").Controls.Add |
With Menü1 |
.BeginGroup = True |
.Caption = "SARI" |
.OnAction = "RENK" |
End With |
Set Menü2 = Application.CommandBars("Cell").Controls.Add |
With Menü2 |
.Caption = "KIRMIZI" |
.OnAction = "RENK" |
End With |
Set Menü3 = Application.CommandBars("Cell").Controls.Add |
With Menü3 |
.Caption = "TURKUAZ" |
.OnAction = "RENK" |
End With |
Set Menü4 = Application.CommandBars("Cell").Controls.Add |
With Menü4 |
.Caption = "HARDAL" |
.OnAction = "RENK" |
End With |
Set Menü5 = Application.CommandBars("Cell").Controls.Add |
With Menü5 |
.Caption = "DOLGU YOK" |
.OnAction = "RENK" |
End With |
|
Application.CommandBars("Row").Reset |
Set Menü1 = Application.CommandBars("Row").Controls.Add |
With Menü1 |
.BeginGroup = True |
.Caption = "SARI" |
.OnAction = "RENK" |
End With |
Set Menü2 = Application.CommandBars("Row").Controls.Add |
With Menü2 |
.Caption = "KIRMIZI" |
.OnAction = "RENK" |
End With |
Set Menü3 = Application.CommandBars("Row").Controls.Add |
With Menü3 |
.Caption = "TURKUAZ" |
.OnAction = "RENK" |
End With |
Set Menü4 = Application.CommandBars("Row").Controls.Add |
With Menü4 |
.Caption = "HARDAL" |
.OnAction = "RENK" |
End With |
Set Menü5 = Application.CommandBars("Row").Controls.Add |
With Menü5 |
.Caption = "DOLGU YOK" |
.OnAction = "RENK" |
End With |
Application.CommandBars("Column").Reset |
Set Menü1 = Application.CommandBars("Column").Controls.Add |
With Menü1 |
.BeginGroup = True |
.Caption = "SARI" |
.OnAction = "RENK" |
End With |
Set Menü2 = Application.CommandBars("Column").Controls.Add |
With Menü2 |
.Caption = "KIRMIZI" |
.OnAction = "RENK" |
End With |
Set Menü3 = Application.CommandBars("Column").Controls.Add |
With Menü3 |
.Caption = "TURKUAZ" |
.OnAction = "RENK" |
End With |
Set Menü4 = Application.CommandBars("Column").Controls.Add |
With Menü4 |
.Caption = "HARDAL" |
.OnAction = "RENK" |
End With |
Set Menü5 = Application.CommandBars("Column").Controls.Add |
With Menü5 |
.Caption = "DOLGU YOK" |
.OnAction = "RENK" |
End With |
End Sub |
Sub RENK() |
Select Case Application.CommandBars.ActionControl.Caption |
Case Is = "SARI": Selection.Interior.ColorIndex = 6 |
Case Is = "KIRMIZI": Selection.Interior.ColorIndex = 3 |
Case Is = "TURKUAZ": Selection.Interior.ColorIndex = 8 |
Case Is = "HARDAL": Selection.Interior.ColorIndex = 45 |
Case Is = "DOLGU YOK": Selection.Interior.ColorIndex = xlNone |
End Select |
End Sub |