Pages

Thursday, March 29, 2012

PAste value only for Ctrl -V

In this workboook:


Private Sub Workbook_Open()
Application.OnKey "^v", "DoMyPaste"
End Sub

In module :

Public Sub DoMyPaste()

On Error Resume Next
ActiveSheet.PasteSpecial Format:=Text, Link:=False, DisplayAsIcon:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

End Sub

Wednesday, March 28, 2012

Excel Paste Value only

http://www.mrexcel.com/archive/VBA/4522.html

perl 2 array

my @num = qw (1 2 3 4 5); my @alp = qw (A B C D E); #One way for my $index (0 .. $#num) { print "$num[$index]-$alp[$index]\n"; } #Or print "$num[$_]-$alp[$_]\n" for (0 .. $#num);

Monday, March 26, 2012

file and dirhandle for perl

($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);


http://perldoc.perl.org/functions/stat.html

Wednesday, March 21, 2012

@files = ;

Or if you just want a list of the files with the extension .html:


@files = ;



-e File exists.
-z File has zero size (is empty).
-s File has nonzero size (returns size in bytes).
-f File is a plain file.
-d File is a directory.
-l File is a symbolic link.

Tuesday, March 20, 2012

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Application.CutCopyMode = False Then Exit Sub
Application.EnableEvents = False
Application.Undo
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.EnableEvents = True
End Sub

method1:
sub PasteValues()

' Keyboard Shortcut: Ctrl+v

On Error Resume Next

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

Sub Auto_Open()


Application.CommandBars("Cell").Reset
With Application.CommandBars("Cell")
.Controls("Paste").OnAction = "PasteValues" ' Changes right click cell paste to use Pastevalues macro
.Controls(4).Delete ' removes paste secial option
End With

Application.CommandBars("Row").Reset
With Application.CommandBars("Row")
.Controls("Paste").OnAction = "PasteValues" ' Changes right click row paste to use Pastevalues macro
.Controls(4).Delete ' removes paste secial option
End With

Application.CommandBars("Column").Reset
With Application.CommandBars("Column")
.Controls("Paste").OnAction = "PasteValues" ' Changes right click column paste to use Pastevalues macro
.Controls(4).Delete ' removes paste secial option
End With

Application.CommandBars("Worksheet Menu Bar").Reset
With Application.CommandBars("Worksheet Menu Bar").Controls
.Item(2).Controls(6).OnAction = "PasteValues" ' changes edit/paste to use Pastevalues macro
.Item(2).Controls(7).Enabled = False ' disable paste special
End With

Application.CommandBars("Standard").Reset
With Application.CommandBars("Standard").Controls.Item(12)
.Enabled = False
End With
End Sub

2.http://www.rondebruin.nl/values.htm

 

site weekly hits