ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing on message box condition? (https://www.excelbanter.com/excel-programming/343611-printing-message-box-condition.html)

Simon Lloyd[_659_]

Printing on message box condition?
 

Does anyone know how to print when a certain condition is present in a
message box e.g if my msgbox has text and value like....Bloggs J has 17
days booked off, is it possible to have some code that then finds all
instances of that name in any column greater than row13 and also select
the corresponding offset from column A paste them in to a workbook then
print them off as 2 columns (if it can be done with out pasting in to a
workbook even better!) so effectively it would look like this:-

So Column A would be the date and the offset may be x amount of columns
away that contains the name Bloggs J

12/2/05 Bloggs J
22/3/05 Bloggs J
4/7/05 Bloggs J

etc.?

Hope you can help,

Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=478639


XPete

Printing on message box condition?
 
Simon, the msgbox is set up with strings and integers already. It would
be a lot easier to test on these, rather than on a msgbox value.

I can imagine that your msgbox is set up something like:

msgbox PersonName & "has " & No_Days & " days booked off"

where PersonName is string that contains Bloggs J and No_Days is the
integer that has the number of days booked off.

Write a do...loop that searches picks up all the values in your sheet
matching the PersonName and paste them into your new sheet/book.

Good luck
Peter



All times are GMT +1. The time now is 05:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com