lệnh gọi form (1 người xem)

Liên hệ QC

Người dùng đang xem chủ đề này

gakon001

Thành viên mới
Tham gia
24/9/11
Bài viết
34
Được thích
1
Sub auto_open()
'
' auto_open Macro
'


'
main.Show
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
Application.ShowSelectionFloaties = False
Application.ShowDevTools = False
Application.EnableLivePreview = False
Application.GenerateTableRefs = xlGenerateTableRefStruct
End Sub

em tạo macro này để gọi form đồng thời tắt một số thanh công cụ. Mọi bữa vẫn chạy tốt, không hiểu sao hôm nay nó bị lỗi
 
Lần chỉnh sửa cuối:
Hiện nay đang lỗi load form Main. Để biết lỗi ở đâu bạn đánh dấu Rem tất các dòng trong Private Sub UserForm_Initialize() của Form Main

Sau đó, bạn mở form =F5 hay nhấn nút Run---> Form load tốt
Giờ bỏ Ren từng dòng hay đoạn While...Wend và lại chạy thử, dần dần vậy bạn sẽ túm được thằng làm lỗi Form của bạn
 
Sub auto_open()
'
' auto_open Macro
'


'
main.Show
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
Application.ShowSelectionFloaties = False
Application.ShowDevTools = False
Application.EnableLivePreview = False
Application.GenerateTableRefs = xlGenerateTableRefStruct
End Sub

em tạo macro này để gọi form đồng thời tắt một số thanh công cụ. Mọi bữa vẫn chạy tốt, không hiểu sao hôm nay nó bị lỗi "select method of range class failed!"
Mấy anh chị giúp em với. Mai em nộp bài rồi !$@!! tks nhiều
FILE link : http://www.mediafire.com/?ary10a5nlv4dqel
Sửa sự kiện UserForm_Initialize thành vầy nhé:
PHP:
Private Sub UserForm_Initialize()
  With ThisWorkbook.Sheets("main")
    .Range("L1").Value = ""
    i = 1
    While .Range("B" & i + 2).Value <> ""
      .Range("B" & i + 2).Value = ""
      i = i + 1
    Wend
  End With
  Me.CommandButton1.Enabled = False
  ActiveWindow.DisplayHeadings = False
  With Application
    .DisplayFormulaBar = False
    .ShowSelectionFloaties = False
    .ShowDevTools = False
    .EnableLivePreview = False
  End With
End Sub
 
Web KT

Bài viết mới nhất

Back
Top Bottom