Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Scrolling Looping Problem | Excel Discussion (Misc queries) | |||
Macro looping problem. | Excel Discussion (Misc queries) | |||
A Strange Printing Problem | New Users to Excel | |||
complex looping problem | Excel Programming | |||
Looping Problem | Excel Programming |