Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Information Box to Macro
HI,
I'd like to add a message box that requires no input to the following macro. The message box should say "Reviewing Row [i]" and should close when the macro is done. THANKS! Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Loop Until i = 300 End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Information Box to Macro
Have you tried
Application.StatusBar = "Reviewing Row [" & i & "]" and before the End Sub put this Application.StatusBar = False -- HTH, Barb Reinhardt "Mr. Matt" wrote: [i] HI, I'd like to add a message box that requires no input to the following macro. The message box should say "Reviewing Row " and should close when the macro is done. THANKS! Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Loop Until i = 300 End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Information Box to Macro
Code now looks like this. Doesn't provide a window (message box) that shows
which row the macro is counting. Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Application.StatusBar = "Reviewing Row [" & i & "]" Loop Until i = 300 Application.StatusBar = False End Sub "Barb Reinhardt" wrote: [i] Have you tried Application.StatusBar = "Reviewing Row [" & i & "]" and before the End Sub put this Application.StatusBar = False -- HTH, Barb Reinhardt "Mr. Matt" wrote: HI, I'd like to add a message box that requires no input to the following macro. The message box should say "Reviewing Row " and should close when the macro is done. THANKS! Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Loop Until i = 300 End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Information Box to Macro
Can you see the statusbar in the bottom left corner? Where you see Ready or
Edit or Enter. If yes, then that's where the message will appear. But with just 300 rows, it'll go by very fast! I have a followup question for you, too. You use Sheets(2) in your code. Is that the sheet with the commandbutton? If yes, then I'd use: Option Explicit Private Sub CommandButton1_Click() Dim iRow As Long Application.ScreenUpdating = False 'hide the flickering For iRow = 7 To 300 Application.StatusBar = "Reviewing Row [" & iRow & "]" If UCase(Me.Cells(iRow, 8).Value) = UCase("Closed") Then Me.Rows(iRow).Hidden = True Else Me.Rows(iRow).Hidden = False 'do you want this??? End If Next iRow With Application .StatusBar = False 'give it back to excel .ScreenUpdating = True End With End Sub If the commandbutton is on a userform -- or processing Sheets(2) from a different sheet, then I'd qualify those ranges with the sheet that I want. Mr. Matt wrote:[i] Code now looks like this. Doesn't provide a window (message box) that shows which row the macro is counting. Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Application.StatusBar = "Reviewing Row [" & i & "]" Loop Until i = 300 Application.StatusBar = False End Sub "Barb Reinhardt" wrote: Have you tried Application.StatusBar = "Reviewing Row [" & i & "]" and before the End Sub put this Application.StatusBar = False -- HTH, Barb Reinhardt "Mr. Matt" wrote: HI, I'd like to add a message box that requires no input to the following macro. The message box should say "Reviewing Row " and should close when the macro is done. THANKS! Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Loop Until i = 300 End Sub -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Information Box to Macro
Ps. If you can't see the statusbar:
Tools|Options|View tab and turn it on. Dave Peterson wrote:[i] Can you see the statusbar in the bottom left corner? Where you see Ready or Edit or Enter. If yes, then that's where the message will appear. But with just 300 rows, it'll go by very fast! I have a followup question for you, too. You use Sheets(2) in your code. Is that the sheet with the commandbutton? If yes, then I'd use: Option Explicit Private Sub CommandButton1_Click() Dim iRow As Long Application.ScreenUpdating = False 'hide the flickering For iRow = 7 To 300 Application.StatusBar = "Reviewing Row [" & iRow & "]" If UCase(Me.Cells(iRow, 8).Value) = UCase("Closed") Then Me.Rows(iRow).Hidden = True Else Me.Rows(iRow).Hidden = False 'do you want this??? End If Next iRow With Application .StatusBar = False 'give it back to excel .ScreenUpdating = True End With End Sub If the commandbutton is on a userform -- or processing Sheets(2) from a different sheet, then I'd qualify those ranges with the sheet that I want. Mr. Matt wrote: Code now looks like this. Doesn't provide a window (message box) that shows which row the macro is counting. Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Application.StatusBar = "Reviewing Row [" & i & "]" Loop Until i = 300 Application.StatusBar = False End Sub "Barb Reinhardt" wrote: Have you tried Application.StatusBar = "Reviewing Row [" & i & "]" and before the End Sub put this Application.StatusBar = False -- HTH, Barb Reinhardt "Mr. Matt" wrote: HI, I'd like to add a message box that requires no input to the following macro. The message box should say "Reviewing Row " and should close when the macro is done. THANKS! Private Sub CommandButton1_Click() Dim i As Long i = 7 Do If Sheets(2).Cells(i, 8).Value = "CLOSED" Then Rows(i).EntireRow.Hidden = True End If i = i + 1 Loop Until i = 300 End Sub -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to extraxt information | Excel Programming | |||
Macro to change information | Excel Discussion (Misc queries) | |||
Macro to retrieve information | Excel Discussion (Misc queries) | |||
INFORMATION MESSAGE BY MACRO | Excel Programming | |||
Macro additional information | Excel Programming |