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: 1
Default strange printing/looping problem

Omar78,

Sorry I had other things come up. Here is my solution.
I placed you msg on sheet2 rang a1. For some reason I couldn't get th
lable to change after each print.

Hope this works for you.

Option Explicit
Public x As Long
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim rng As Range
Dim ans As String
Set rng = Worksheets("Sheet1").Cells(1, 1).CurrentRegion
For x = 1 To rng.Rows.Count
If rng(x, 2) = rng(x, 3) Then
Worksheets("Sheet2").Activate
Range("A1").Value = "congrats" & " " & rng(x, 3)
ans = MsgBox("Do You want to print?" & " congrats" & " "
rng(x, 3), vbYesNo)
If ans = vbYes Then
With Sheets("sheet2")
Worksheets("Sheet2").PrintOut
Range("A1").Value = ""
End With
End If
Else
Sheets("Sheet2").Activate
Range("A1").Value = "BadLuck" & " " & rng(x, 3)
ans = MsgBox("Do You want to print?" & " BadLuck " & " "
rng(x, 3), vbYesNo)
If ans = vbYes Then
With Sheets("sheet2")
Worksheets("Sheet2").PrintOut
Range("A1").Value = ""
End With
End If
End If
Next
End Su

--
Message posted from http://www.ExcelForum.com



 
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
Scrolling Looping Problem Nick Wakeham Excel Discussion (Misc queries) 0 June 12th 07 01:42 PM
Macro looping problem. [email protected] Excel Discussion (Misc queries) 8 October 26th 06 02:44 PM
A Strange Printing Problem PA New Users to Excel 2 July 21st 06 09:15 PM
complex looping problem Max Bialystock Excel Programming 16 April 10th 04 01:56 PM
Looping Problem Todd Huttenstine[_3_] Excel Programming 5 January 25th 04 12:51 AM


All times are GMT +1. The time now is 11:57 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"