Macro or button to pop up printer message!?

N

Neo1

Hello I would like to enable a button or macro that i can easily set up
so that everytime i change a value from a cell the printer message pops
up saying "If i want to print"......can this be done using a macro
without programming?

Thanks for your time
From John
 
P

Paul B

John, I think you would need to use a worksheet change event for that,
something like this, put in sheet code, right click on the sheet tab and
paste the code in the window that opens

Private Sub Worksheet_Change(ByVal Target As Range)
'will bring up the message box when you change the data in A1
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address = "$A$1" Then

Msg = "Do You Want To Print This Sheet"
Title = "Print ?"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)

'if you click no, exit sub
If Response = vbNo Then
Exit Sub
End If


'if you click yes print the sheet
ActiveSheet.PrintOut Copies:=1, Collate:=False
End If

End Sub



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
B

Bob Phillips

Do you really want this every time. It will get really annoying, I would
have thought more selection messaging would be better.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Paul B said:
John, I think you would need to use a worksheet change event for that,
something like this, put in sheet code, right click on the sheet tab and
paste the code in the window that opens

Private Sub Worksheet_Change(ByVal Target As Range)
'will bring up the message box when you change the data in A1
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address = "$A$1" Then

Msg = "Do You Want To Print This Sheet"
Title = "Print ?"
Response = MsgBox(Msg, vbYesNo + vbQuestion, Title)

'if you click no, exit sub
If Response = vbNo Then
Exit Sub
End If


'if you click yes print the sheet
ActiveSheet.PrintOut Copies:=1, Collate:=False
End If

End Sub



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 
N

Neo1

Thing is I can't include any sort of programming in the spreadsheet
model..isnt there another way to make this message pop up? what is
selection messaging

Thanks
From John
 
B

Bob Phillips

That would still be code, but targeted at particular instances, time, or
some other criteria.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Top