om om om, inti pertanyaannya sebenarnya ......... : " Bagaimana supaya jika user melakukan copy dr [Cells Sumber] sebagai sumber kemudian melakukan paste ke [Cells Target] , maka yang di paste (Klik Kanan PASTE SPESIAL maupun PASTE BIASA ( Ctrl+V ) hanya nilai nya saja sehingga format [Cells Sumber] tetap numerik. dalam artian disini PASTESPESIAL VALUE DOANK......." Ok.... oom ini Bisa dilakukan dengan menggunakan MAKRO VBA Pada Excel......dengan Kriteria, Sbb : "Di Wookbook Ini, Fungsi kopi (kosongan ataupun mengandung formula) akan di PASTE Selalu Menghasilkan PASTE SPESIAL VALUE DOANK meskipun dengan menggunakan PASTE BIASA-BUKAN SPESIAL..... Sehingga Cells Target Paste yang Mengandung Data Validation ataupun Format CellsTIDAK TERHAPUS Karena Paste Spesial Value Doank... Aturan Main : Dengan mematikan "CUT" dan Merubah PASTE (Ctrl + V) Menjadi PASTE SPESIAL VALUE DOANK.....Bisa dengan Menggunakan : --> Klik Kanan Kopi (Ctrl+C)Pada Sumber dan Klik Kanan Paste Biasa (Ctrl + V) Pada Target Cells tapi menghasilkan PASTE SPESIAL VALUE Untuk Kodingannya OOmmm (File Terlampir) Agak Banyak OOmmm saya menggunakan Excel 2003(Gak tau kalo di 07 jalan gak) : - Koding Pada This Woorkbook : Option Explicit Private Sub Workbook_Activate( Debug.Print "Workbook_Activate" ForcePasteSpecial End Sub Private Sub Workbook_Deactivate Debug.Print "Workbook_Deactivat ReleasePasteControl End Sub - Koding Pada Modul: Option Explicit Option Private Module Option Compare Binary Private m_oPasteFile As Object Private Const m_sFSO_c As String = "Scripting.FileSyst Private Const m_sPasteProcedure_ Private Const m_sUbndoProcedure_ Private Const m_sCutWarningProced Private m_oWS As Excel.Worksheet 'Microsoft Scripting Runtime Constants: Private Const TristateTrue As Long = -1 Private Const ForReading As Long = 1 Private Const ForWriting As Long = 2 Private Const TemporaryFolder As Long = 2 'Error Handling Constants: Private Const m_sTitle_c As String = "Error Number: " Private Const m_lButtons_c As Long = vbExclamation + vbMsgBoxSetForegrou 'Interface Control Constants: Const m_sTag_c As String = "ForcePaste" ' ************ Public Sub ForcePasteSpecial( LockInterface Excel.Application. Excel.Application. Excel.Application. ReplacePasteButtons CutButtonsEnable False Exit_Proc: On Error Resume Next UnlockInterface Exit Sub Err_Hnd: VBA.MsgBox VBA.Err.Description Resume Exit_Proc End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Paste Dijalankan ............ ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Public Sub ReleasePasteControl On Error GoTo Err_Hnd LockInterface Excel.Application. Excel.Application. Excel.Application. RestorePasteButtons CutButtonsEnable True Exit_Proc: On Error Resume Next m_oPasteFile. UnlockInterface Exit Sub Err_Hnd: VBA.MsgBox VBA.Err.Description Resume Exit_Proc End Sub ' ************ ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Paste Spesial ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub PasteSpecial( On Error GoTo Err_Hnd Dim bRunOnce As Boolean Dim oFSO As Object Dim oTS As Object Dim oCll As Excel.Range Dim oDataRng As Excel.Range Dim lLstRow As Long Dim sTmpPth As String Const lPasteError_ Const lFNFError_c As Long = 53 LockInterface If Excel.ActiveWorkboo Set oFSO = VBA.CreateObject( If m_oPasteFile Is Nothing Then CreateFile: sTmpPth = oFSO.BuildPath( Else sTmpPth = m_oPasteFile. End If If oFSO.FileExists( oFSO.CreateTextFile sTmpPth, True, True Set m_oPasteFile = oFSO.GetFile( Set oTS = m_oPasteFile. Set oDataRng = Excel.ActiveSheet. lLstRow = oDataRng.Row oTS.WriteLine oDataRng.Address For Each oCll In oDataRng.Cells If lLstRow <> oCll.Row Then lLstRow = oCll.Row oTS.Write vbNewLine End If oTS.Write oCll.Formula & vbTab Next oCll Set m_oWS = Excel.ActiveSheet Excel.Selection. Excel.Application. Else Excel.ActiveSheet. End If Exit_Proc: On Error Resume Next oTS.Close UnlockInterface Exit Sub Err_Hnd: Select Case VBA.Err.Number Case lPasteError_ If Not bRunOnce Then bRunOnce = True VBA.Err.Clear If Excel.Application. Resume Next Else Resume Exit_Proc End If End If Case lFNFError_c Resume CreateFile End Select VBA.MsgBox VBA.Err.Description Resume Exit_Proc Resume End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Batalkan Paste Spesial ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub UndoPasteSpecial( On Error GoTo Err_Hnd Dim oTS As Object Dim lRow As Long Dim lCol As Long Dim vLine As Variant Dim sAddress As String Dim lColOffset As Long Const lLimit_c As Long = 256 Const lStep_c As Long = 1 Const lZero_c As Long = 0 Const lOffset_c As Long = 1 LockInterface If m_oPasteFile Is Nothing Then VBA.Err.Raise vbObjectError, m_sUbndoProcedure_ End If Set oTS = m_oPasteFile. If Not oTS.AtEndOfStream Then sAddress = oTS.ReadLine With m_oWS.Range( lColOffset = .Column lRow = .Row End With End If m_oWS.UsedRange. Do Until oTS.AtEndOfStream vLine = VBA.Split(oTS. For lCol = lZero_c To UBound(vLine) If VBA.IsNumeric( m_oWS.Cells( Else m_oWS.Cells( End If Next lRow = lRow + lStep_c Loop Exit_Proc: On Error Resume Next oTS.Close UnlockInterface Exit Sub Err_Hnd: VBA.MsgBox VBA.Err.Description Resume Exit_Proc Resume End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Merubah me.popup Paste Biasa menjadi Paste Spesial ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub ReplacePasteButtons On Error GoTo Err_Hnd Dim oPasteBtns As Office.CommandBarCo Dim oPasteBtn As Office.CommandBarBu Dim oNewBtn As Office.CommandBarBu Const lIDPaste_c As Long = 22 RestorePasteButtons Set oPasteBtns = Excel.Application. For Each oPasteBtn In oPasteBtns Set oNewBtn = oPasteBtn.Parent. oNewBtn.FaceId = lIDPaste_c oNewBtn.Caption = oPasteBtn.Caption oNewBtn.TooltipText = oPasteBtn.TooltipTe oNewBtn.Style = oPasteBtn.Style oNewBtn.BeginGroup = oPasteBtn.BeginGrou oNewBtn.Tag = m_sTag_c oNewBtn.OnAction = m_sPasteProcedure_ oPasteBtn.Visible = False Next Exit Sub Err_Hnd: VBA.MsgBox VBA.Err.Description End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Kembalikan me.popup Paste Biasa ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub RestorePasteButtons On Error GoTo Err_Hnd Dim oBtns As Office.CommandBarCo Dim oBtn As Office.CommandBarBu Const lIDPaste_c As Long = 22 Const m_sTag_c As String = "ForcePaste" Set oBtns = Excel.Application. For Each oBtn In oBtns oBtn.Visible = True Next Set oBtns = Excel.Application. If Not oBtns Is Nothing Then For Each oBtn In oBtns oBtn.Delete Next End If Exit Sub Err_Hnd: VBA.MsgBox VBA.Err.Description End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Merubah Button Cut menjadi Enabeld (Berfungsi) ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub CutButtonsEnable( On Error GoTo Err_Hnd Dim oCutBtns As Office.CommandBarCo Dim oCutBtn As Office.CommandBarBu Const lIDCut_c As Long = 21 Set oCutBtns = Excel.Application. For Each oCutBtn In oCutBtns oCutBtn.Enabled = EnableButton Next Exit Sub Err_Hnd: VBA.MsgBox VBA.Err.Description End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Pelanggaran Cut karena nekat digunakan (^o^) ho ho ho ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub CutWarning() On Error Resume Next VBA.MsgBox "Kegunaan ""[Cut]"" tidak dapat digunakan di Woorkbook ini.", vbInformation + vbMsgBoxSetForegrou End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Mengunci Aplikasi Excel yang sedang digunakan ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub LockInterface( With Excel.Application .EnableEvents = False .ScreenUpdating = False .Cursor = xlWait .EnableCancelKey = xlErrorHandler End With End Sub ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ' Membuka Aplikasi Excel yang sedang digunakan ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Private Sub UnlockInterface( With Excel.Application .EnableEvents = True .ScreenUpdating = True .Cursor = xlDefault .EnableCancelKey = xlInterrupt End With End Sub Semoga Sesuai Dengan Harapan Si oom......... ~ ^ Puthut Wibowo ^ ~ --- On Sat, 9/26/09, Ruud wong <ruud_mail2007@
|
| Tolong cariin momods kerjaan jadi direktur dongggg... :D :D :D |
| http://www.facebook.com/group.php?gid=37671048001&ref=mf |
+-------------------------------------------------------------------+
| DILARANG : MLM, money game, OOT, iklan tanpa izin, SARA, testing, |
| pembicaraan pribadi, one line message, melecehkan, tidak sopan. |
+-------------------------------------------------------------------+
| Buat subjek yang kreatif, jangan : "tanya", "help", "mohon bantu" |
| Usahakan besar attachment < 200 kb. Gunakan winzip jika perlu. |
+-------------------------------------------------------------------+
| Ajak teman-teman Anda bergabung dengan mengirim e-mail kosong ke |
| XL-mania-subscribe@yahoogroups.com atau kirimkan mereka file dari |
| http://groups.yahoo.com/group/XL-mania/files/Promotion/ |
+-------------------------------------------------------------------+
| Berikan testimoni di : http://www.friendster.com/xlmania atau... |
| http://www.xl-mania.com/2008/06/testimoni-xl-mania.html |
+-------------------------------------------------------------------+
| Message lama ada di : |
| http://groups.yahoo.com/group/XL-mania/messages [perlu yahoo id] |
| http://www.mail-archive.com/xl-mania@yahoogroups.com |
+-------------------------------------------------------------------+
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Nenhum comentário:
Postar um comentário