LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default pause macro to make changes before printing.

Thanks...it worked like a charm!!

"Tom Ogilvy" wrote:

if Range("H17").Value = 0 then
rows(17).EntireRow.Hidden = True
else
rows(17).Entirerow.Hidden = False
end if

--
Regards,
Tom Ogilvy


"Baffee" wrote:

Thanks. I was hoping there was a work around but at least I can stop
searching.

I thought about doing it that way, but the person I'm doing this for wanted
me to try it with a pause and a message box.

I would like to hide row 17, H17 is 0 etc. Could you give me a hint on what
the code woudl be. I usually program in Ascess and Excel is a bit different.


I got as far as:
Rows("17:17").Select
Selection.EntireRowHidden = True

I don't know how to write the if statement and reference Cell H17 =0.


Thanks!

"Tom Ogilvy" wrote:

A msgbox is modal. So as you say, the macro is still running.

There is no provision for doing what you describe. Why can't you put code
in your procedure that recognizes when rows should be hidden and have the
code hide them.

--
Regards,
Tom Ogilvy


"Baffee" wrote:

We have 4 pages in the workbook. The first 3 represent payroll info for 3
years. The 4th has summary for an employee showing the 3 years. The code
below scrolls through changing each cell reference to each employee and
printing out a report.
There are some rows that represent info that we do not want to show if it
does not pertain to an employee (bonuses). I am trying change the cell
reference and then pause while the unnecessary rows are manually hidden,
print the report and loop to the next employee.

The message box causes a pause, however the hourglass is still there and I
can't make any modifications. How do I get aroun this? It looks to me that
the macro is still running and that's why I can't make changes.

Sub macro1()
For Emp = 8 To 63
Application.Goto Reference:="Name"
ActiveCell.Replace What:=Emp, Replacement:=Emp + 1, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Cells.Find(What:=Emp, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
, SearchFormat:=False).Activate
Application.Goto Reference:="Wages"
Selection.Replace What:=Emp, Replacement:=Emp + 1, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.Goto Reference:="Benefits"
Selection.Replace What:=Emp, Replacement:=Emp + 1, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.Goto Reference:="Hours"
Selection.Replace What:=Emp, Replacement:=Emp + 1, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.Goto Reference:="Rate"
Selection.Replace What:=Emp, Replacement:=Emp + 1, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
MsgBox ("Make changes to the report")
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next Emp
End Sub


Thanks!



 
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
Pause between copies of Excel sheets while printing waybomb Excel Discussion (Misc queries) 1 August 8th 08 04:50 PM
How do I pause a macro? Dave H Excel Discussion (Misc queries) 5 May 3rd 08 04:53 PM
Pause Macro 2 Ollie Excel Discussion (Misc queries) 3 June 15th 06 04:49 AM
Pause Macro cottage6 Excel Programming 2 April 14th 06 04:23 PM
Pause a Macro? Jimbo Excel Programming 2 October 14th 04 04:21 AM


All times are GMT +1. The time now is 03:45 PM.

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

About Us

"It's about Microsoft Excel"