langtuchungtinh360
Thành viên đã dừng hoạt động
- Tham gia
- 7/10/13
- Bài viết
- 1,062
- Được thích
- 334
mọi người cho mình hỏi
mình có 1 đoạn code thế này
Option Explicit
Function CommPic(Pic As String, Cel As Range) As String
'CHENANH
On Error Resume Next
Application.ScreenUpdating = False
Dim mRng As Range
On Error Resume Next
Application.Volatile
Cel(1, 1).Comment.Delete
If Cel(1, 1).Comment Is Nothing Then Cel(1, 1).AddComment
Cel(1, 1).Comment.Text vbLf
Set mRng = Cel(1, 1).MergeArea
If mRng Is Nothing Then Set mRng = Cel(1, 1)
With Cel(1, 1).Comment.Shape
.Shadow.Visible = msoFalse
.Line.Visible = msoFalse
.AutoShapeType = msoShapeRectangle
.Left = mRng.Left: .Top = mRng.Top: .Visible = True
.Width = mRng.Width: .Height = mRng.Height
.Fill.UserPicture Pic
End With
Application.ScreenUpdating = True
On Error GoTo 0
End Function
mình chỉ cần nó chạy ở vài sheet thôi, chứ không chạy hết sheet. ví dụ như file mình gửi thì chỉ cần chạy code đó trên sheet DC NTCT NTBT còn các sheet kia không cần. mấy sheet kia không cần mà nó vẫn chạy nên làm cho tốc độ chạy code trở nên lâu hơn. mọi người giúp mình sửa lại thế nào để cho đoạn code trên chỉ chạy trong những sheet DC, NTCT, NTBT thôi nhé. mong được mọi người giúp chứ đừng mở file lên thấy lu bu đóng file luôn. ^^
http://www.mediafire.com/download/n4...2x/HosoKCS.rar
https://www.fshare.vn/file/GOSNMTZBA7TB
mình có 1 đoạn code thế này
Option Explicit
Function CommPic(Pic As String, Cel As Range) As String
'CHENANH
On Error Resume Next
Application.ScreenUpdating = False
Dim mRng As Range
On Error Resume Next
Application.Volatile
Cel(1, 1).Comment.Delete
If Cel(1, 1).Comment Is Nothing Then Cel(1, 1).AddComment
Cel(1, 1).Comment.Text vbLf
Set mRng = Cel(1, 1).MergeArea
If mRng Is Nothing Then Set mRng = Cel(1, 1)
With Cel(1, 1).Comment.Shape
.Shadow.Visible = msoFalse
.Line.Visible = msoFalse
.AutoShapeType = msoShapeRectangle
.Left = mRng.Left: .Top = mRng.Top: .Visible = True
.Width = mRng.Width: .Height = mRng.Height
.Fill.UserPicture Pic
End With
Application.ScreenUpdating = True
On Error GoTo 0
End Function
mình chỉ cần nó chạy ở vài sheet thôi, chứ không chạy hết sheet. ví dụ như file mình gửi thì chỉ cần chạy code đó trên sheet DC NTCT NTBT còn các sheet kia không cần. mấy sheet kia không cần mà nó vẫn chạy nên làm cho tốc độ chạy code trở nên lâu hơn. mọi người giúp mình sửa lại thế nào để cho đoạn code trên chỉ chạy trong những sheet DC, NTCT, NTBT thôi nhé. mong được mọi người giúp chứ đừng mở file lên thấy lu bu đóng file luôn. ^^
http://www.mediafire.com/download/n4...2x/HosoKCS.rar
https://www.fshare.vn/file/GOSNMTZBA7TB
Lần chỉnh sửa cuối: