Bạn ơi. Vậy Bạn đã giúp thì giúp cho trót nhé
Mình muốn là xóa dữ liệu Sheet Nhập thì đồng thời xóa dữ liệu Sheet Tồn luôn.
Cám ơn Bạn
Bạn ơi. Vậy Bạn đã giúp thì giúp cho trót nhé
Mình muốn là xóa dữ liệu Sheet Nhập thì đồng thời xóa dữ liệu Sheet Tồn luôn.
Cám ơn Bạn
Code (Paste Code này vào Sheet NHAP):Gửi bởi nguyentruongvan
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shCore.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shAutoloader.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushAppleScript.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushAS3.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushBash.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushColdFusion.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushDelphi.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushDiff.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushErlang.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushGroovy.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushJavaFx.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushPerl.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushPowerShell.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushPython.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushRuby.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushSass.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushScala.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushVb.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shBrushXml.js"></script>
<script type="text/javascript" src="/forum/vctinh_xcode/scripts/shAutoloader.js"></script>
<link type="text/css" rel="stylesheet" href="/forum/vctinh_xcode/styles/shCoreDefault.css">
<link type="text/css" rel="Stylesheet" href="/forum/vctinh_xcode/styles/shThemeDefault.css">
<pre class="brush: vb; toolbar: false;">Private Sub Worksheet_Change(ByVal Target As Range)
Dim vung As Range
Dim WsTim As String
Dim Dic As Object
Dim i As Long
Dim Tam
Set Dic = CreateObject("Scripting.Dictionary")
Set vung = Range([A2], [G65536])
WsTim = Sheets("TON").Name
Application.EnableEvents = False
If Not Intersect(Target, vung) Is Nothing Then
If Target.Activate <> "" Then
For i = 2 To [B65536].End(xlUp).Row
If Cells(i, 2) <> "" Then
If i <> ActiveCell.Row Then
Tam = Cells(i, 2).Value
If Not Dic.exists(Tam) Then
Dic.Add Tam, i
End If
End If
End If
Next
If Dic.exists(ActiveCell.Value) Then
MsgBox "Da ton tai, khong the danh duoc"
ActiveCell.ClearContents
End If
Range([A2], [G65536]).Copy Sheets(WsTim).[A2]
End If
End If
Application.EnableEvents = True
End Sub</pre>
<script type="text/javascript">
function path()
{
var args = arguments,
result = []
;
for(var i = 0; i < args.length; i++)
result.push(args[i].replace('@', '/forum/vctinh_xcode/scripts/'));
return result;
};
SyntaxHighlighter.autoloader.apply(null, path(
'applescript @shBrushAppleScript.js',
'actionscript3 as3 @shBrushAS3.js',
'ahk autohotkey @shBrushAhk.js',
'asm x86 @shBrushAsm.js',
'bash shell @shBrushBash.js',
'coldfusion cf @shBrushColdFusion.js',
'cpp c @shBrushCpp.js',
'c# c-sharp csharp @shBrushCSharp.js',
'css @shBrushCss.js',
'delphi pascal @shBrushDelphi.js',
'diff patch pas @shBrushDiff.js',
'erl erlang @shBrushErlang.js',
'groovy @shBrushGroovy.js',
'java @shBrushJava.js',
'jfx javafx @shBrushJavaFX.js',
'js jscript javascript @shBrushJScript.js',
'perl pl @shBrushPerl.js',
'php @shBrushPhp.js',
'text plain @shBrushPlain.js',
'py python @shBrushPython.js',
'ruby rails ror rb @shBrushRuby.js',
'sass scss @shBrushSass.js',
'scala @shBrushScala.js',
'sql SQL @shBrushSql.js',
'vb vbnet vba @shBrushVb.js',
'xml xhtml xslt html @shBrushXml.js'
));
SyntaxHighlighter.config.stripBrs = true;
SyntaxHighlighter.all();
</script>
File đính kèm ở dưới đã bao gồm:
- Tự động cảnh báo gõ trùng tại cột B Sheet Nhap.
- Tự động nhập dữ liệu ở Sheet Ton khi gõ dữ liệu ở Sheet Nhap.
- Tự động xóa dữ liệu ở Sheet Ton khi xóa dữ liệu ở Sheet Nhap.