thatgirl100
Technical User
Hello,
Let me see if I can explain this clearly.
I have an excel workbook containing many different worksheets. On the worksheet "Reports", there are a series of VLOOKUP commands that grab values from other worksheets based on the Physician Number in cell 'C3'.
In a 2nd worksheet "Physicians", column A contains the physician type (e.g. Doctor, Nurse), and column B contains the physician number.
Column A Column B
Doctor 1001
Doctor 1002
Doctor 1003
Nurse 2001
Nurse 2002
Nurse 2003
I have created a command button on the worksheet "Reports" called 'Print by Physician Type'.
What I want to do is have code behind that command button that will look at the worksheet "Physicians", look for 'Doctor' in Column A, grab the first physician number in Column B that corresponds to it, paste it in cell C3 in the worksheet "Reports", and have it print the information on that worksheet. I want it to then loop through each physician number with a Type "Doctor" and print each time (since all the values change accordingly).
I'd also like to have a prompt, so that it will ask me "What Physician Type Would you like to print?" so that I can print all the reports for Nurses, etc.
I'd really appreciate any help on this matter as I am very new to VBA code.
Thanks,
Kirstin
Let me see if I can explain this clearly.
I have an excel workbook containing many different worksheets. On the worksheet "Reports", there are a series of VLOOKUP commands that grab values from other worksheets based on the Physician Number in cell 'C3'.
In a 2nd worksheet "Physicians", column A contains the physician type (e.g. Doctor, Nurse), and column B contains the physician number.
Column A Column B
Doctor 1001
Doctor 1002
Doctor 1003
Nurse 2001
Nurse 2002
Nurse 2003
I have created a command button on the worksheet "Reports" called 'Print by Physician Type'.
What I want to do is have code behind that command button that will look at the worksheet "Physicians", look for 'Doctor' in Column A, grab the first physician number in Column B that corresponds to it, paste it in cell C3 in the worksheet "Reports", and have it print the information on that worksheet. I want it to then loop through each physician number with a Type "Doctor" and print each time (since all the values change accordingly).
I'd also like to have a prompt, so that it will ask me "What Physician Type Would you like to print?" so that I can print all the reports for Nurses, etc.
I'd really appreciate any help on this matter as I am very new to VBA code.
Thanks,
Kirstin