2017-10-07 10 views
-1

今日、私はVBAコードの下にVBAコードを入れて、2つのマクロを呼び出すときにステータスバーを表示したいが、うまくいかない、エラーはない、msgbox 'done'が現れ、実行されるべき2つのマクロも実行されない。誰がコードに間違っているのか知っていますか?ありがとうございました。 Application.StatusBar = FalseExcel VBA進捗状況バー/ステータスバー

Sub LOOP_GENERATEREPORT() 
Dim I As Integer 
Dim loopRng As RANGE 
Dim r As RANGE 

'----progress bar 
Dim x As Integer 
Dim MyTimer As Double 
'------/progress bar 

Application.ScreenUpdating = False 

Sheet10.Activate 
    y = Sheet10.RANGE("a24").Value 
    For I = 1 To lastRow 

'---------progress bar 
Application.StatusBar = False 
'----------/progress bar 


For Each r In Sheet10.RANGE("a26", RANGE("a" & Rows.Count).End(xlUp)) 
    Sheet2.RANGE("ae8").Value = r.Value 
Set loopRng = Worksheets("setting").RANGE("a24") 

ActiveWindow.ScrollRow = loopRng 
Application.CutCopyMode = False 

Application.DisplayAlerts = True 
Application.ScreenUpdating = False 

' ---------progress bar 
Application.StatusBar = "SMART Report printing in progress, please wait..." & I & " of " & y + 0 & " or " & Format((I - 1)/y, "0.00%") & "." 

Call convertformula 
Call CopySummaryRow44 

Next r 
Next I 

'---------progress bar 
Application.StatusBar = True 
'----------/progress bar 

Sheet2.Activate 
MsgBox "DONE" 
Sheet2.RANGE("ae8").Select 

End Sub 
+0

現在の結果が何であるかを知るために役立つことでしょうか?エラーメッセージが表示されますか?マクロを実行した後、https://stackoverflow.com/help/how-to-ask – QHarr

+0

のメッセージボックスを使用して質問を編集することを検討してください。msgbox 'done'が表示されました。何が起こっている?ウルガイダンスのために – robin

+0

tq、私は私の質問を修正しました。 – robin

答えて

0

False間違っている:あなたは、例えば、文字列を提供する必要があります

Application.StatusBar = "False" ' to display "False" 

または

Application.StatusBar = "" ' to cancel 

など

+0

ありがとうございました – robin