[Solved] Identify if number is exist, and save new one if not exist

Ahmd.HM

New member
Hello dear,
I have a file which is used to set the appointments for OPD, and each patient should have a phone number in his data, but sometimes he don't have it and I get the number in the next session, at the next session we already have patient data without phone number and I have to add it to patient's data.
in the attached file, in the sheet "Main" I enter daily data and after that move it to sheet "SchT" by macro assigned to truck icon
I added column to know if the patient had phone number or no (sheet "Main" >>> column "N"), if he hadn't (or maybe the number was changed), I have to enter it and save it in the sheet "LineList" >>> column "H".
that means if the patient had a number it will be shown in column "N", if he didn't or he changed it I will enter it in the next column (sheet "Main" >>> "O")
what I need is a way to save the phone numbers in sheet "Main" >>> "O" into the sheet "LineList"
I need a macro that take the patient code if he has phone number in "Main" >>> "O", after that search for the patient code in the sheet "LineList" and save the phone number in column "H" aligned the patient code.

many thanks 💐💐💐
 

Attachments

  • Sch-OPD.xlsm
    619.5 KB · Views: 1
Hello dear,
I have a file which is used to set the appointments for OPD, and each patient should have a phone number in his data, but sometimes he don't have it and I get the number in the next session, at the next session we already have patient data without phone number and I have to add it to patient's data.
in the attached file, in the sheet "Main" I enter daily data and after that move it to sheet "SchT" by macro assigned to truck icon
I added column to know if the patient had phone number or no (sheet "Main" >>> column "N"), if he hadn't (or maybe the number was changed), I have to enter it and save it in the sheet "LineList" >>> column "H".
that means if the patient had a number it will be shown in column "N", if he didn't or he changed it I will enter it in the next column (sheet "Main" >>> "O")
what I need is a way to save the phone numbers in sheet "Main" >>> "O" into the sheet "LineList"
I need a macro that take the patient code if he has phone number in "Main" >>> "O", after that search for the patient code in the sheet "LineList" and save the phone number in column "H" aligned the patient code.

many thanks 💐💐💐

Dear Ahmed,

Thank you for posting on our Excedemy forum. Based on the requirements you mentioned, I have developed a VBA code for you. You can run the code by clicking on the phone icon (on the right side of the truck icon). This code will transfer any newly added phone numbers in column O of the Main worksheet to the corresponding row of the patient in the LineList sheet in column H.

Please run the code on your computer and let us know if it is working properly. We appreciate any feedback you can provide.

Best regards,
 

Attachments

  • Sch-OPD -Modified.xlsm
    628.3 KB · Views: 3
Dear Ahmed,

Thank you for posting on our Excedemy forum. Based on the requirements you mentioned, I have developed a VBA code for you. You can run the code by clicking on the phone icon (on the right side of the truck icon). This code will transfer any newly added phone numbers in column O of the Main worksheet to the corresponding row of the patient in the LineList sheet in column H.

Please run the code on your computer and let us know if it is working properly. We appreciate any feedback you can provide.

Best regards,
that is exactly what I need, it worked perfectly, thank you so much sir
I really appreciate your efforts and help

💐💐big thanks 💐💐
 

Online statistics

Members online
0
Guests online
48
Total visitors
48

Forum statistics

Threads
292
Messages
1,268
Members
531
Latest member
lonkfps
Top