Phần mềm nhập liệu và tổng hợp báo cáo theo nhiều tiêu chí
Đào tạo Excel - Lập trình VBA - Thiết kế phần mềm Excel theo yêu cầu
Sub Test() Dim KhoiTao, ThuMuc, DoiTuong Set KhoiTao = CreateObject("Shell.Application") Set ThuMuc = KhoiTao.Namespace(&H1A&) Set DoiTuong = ThuMuc.Self MsgBox DoiTuong.Path Set KhoiTao = Nothing Set ThuMuc = Nothing Set DoiTuong = Nothing End Sub
Sub Test() Dim KhoiTao, ThuMuc, DoiTuong Set KhoiTao = CreateObject("Shell.Application") Set ThuMuc = KhoiTao.Namespace(&H1A&) Set DoiTuong = ThuMuc.Self MsgBox DoiTuong.Path Set KhoiTao = Nothing Set ThuMuc = Nothing Set DoiTuong = Nothing End Sub
Private Sub test() MsgBox "USERNAME: " & Environ("USERNAME") & vbNewLine & "COMPUTERNAME: " & Environ("COMPUTERNAME") _ & vbNewLine & "WINDIR: " & Environ("WINDIR") & vbNewLine & "TEMP: " & Environ("TEMP") End Sub
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, [A:A]) Is Nothing Or Target.Row = 1 Then Exit Sub On Error GoTo Err_ Target(, 2).Worksheet.Shapes(Target.Address).Delete Err_: With ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & Target.Value & ".jpg") .Name = Target.Address .Top = Target.Top .Left = Target(, 2).Left .ShapeRange.LockAspectRatio = msoFalse .ShapeRange.Height = Target.Height .ShapeRange.Width = Target(, 2).Width End With Target.Offset(1, 0).Select End Sub
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, [A:A]) Is Nothing Or Target.Row = 1 Then Exit Sub On Error Resume Next Target(, 2).Worksheet.Shapes(Target.Address).Delete On Error GoTo Thoat With Sheet2 .Shapes(.Range("data").Find(Target.Value, , xlValues, xlWhole).Value).CopyPicture End With ActiveSheet.PasteSpecial With Selection .Name = Target.Address .Top = Target.Top .Left = Target(, 2).Left .ShapeRange.LockAspectRatio = msoFalse .ShapeRange.Height = Target.Height .ShapeRange.Width = Target(, 2).Width End With Thoat: Target.Offset(1, 0).Select End Sub
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, [A:A]) Is Nothing Or Target.Row = 1 Then Exit Sub On Error GoTo Err_ Target(, 2).Worksheet.Shapes(Target.Address).Delete Err_: With ActiveSheet.Pictures.Insert(ThisWorkbook.Path & "\" & Target.Value & ".jpg") .Name = Target.Address .Top = Target.Top .Left = Target(, 2).Left .ShapeRange.LockAspectRatio = msoFalse .ShapeRange.Height = Target.Height .ShapeRange.Width = Target(, 2).Width End With Target.Offset(1, 0).Select End Sub
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, [A:A]) Is Nothing Or Target.Row = 1 Then Exit Sub On Error Resume Next Target(, 2).Worksheet.Shapes(Target.Address).Delete On Error GoTo Thoat With Sheet2 .Shapes(.Range("data").Find(Target.Value, , xlValues, xlWhole).Value).CopyPicture End With ActiveSheet.PasteSpecial With Selection .Name = Target.Address .Top = Target.Top .Left = Target(, 2).Left .ShapeRange.LockAspectRatio = msoFalse .ShapeRange.Height = Target.Height .ShapeRange.Width = Target(, 2).Width End With Thoat: Target.Offset(1, 0).Select End Sub
ThisWorkbook.VBProject.VBComponents(ThisWorkbook.Worksheets("sheet1").CodeName).Name _ = "NewCodeName"
ThisWorkbook.VBProject.VBComponents(ThisWorkbook.Worksheets("sheet1").CodeName).Name _ = "NewCodeName"