Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to extraxt information Bradly Excel Programming 2 October 1st 09 03:23 PM
Macro to change information Unique713 Excel Discussion (Misc queries) 0 December 16th 08 08:09 PM
Macro to retrieve information Unique713 Excel Discussion (Misc queries) 2 November 25th 08 04:05 PM
INFORMATION MESSAGE BY MACRO K[_2_] Excel Programming 1 April 15th 08 11:12 PM
Macro additional information LRay67 Excel Programming 1 March 12th 08 04:02 PM


All times are GMT +1. The time now is 10:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"