VBA for locking sheet after submission of report with date and time stamp

jayanta1978

New Member
Joined
Sep 23, 2016
Messages
1
Dear Friend,

Please help me with VBA or Functions for the following problem for my project.

1- in "Sheet" 1-31 is day wise report of an sales representative. , he will be submitting his call for the day and at the end of his submissions
he will click on "SUBMIT REPORT" button and his report will be for the day will be locked for editing, similarly it will be for Sheet 1-31
2- In each sheet "DATE OF SUBMISSION" i.e G4 cell will get the date and time stamp of his report submission.
3- In DR_LIST Sheet I need the Dr's visit dates of each Dr. reported (Preferably with function or formula)



PROJECT (Repaired).xlsx
ABCDEFGHIJKL
1
2
3
4Daily Call Report For :01/09/2021Date of Submission:Day :WedArea As Per TP :ASANSOL
5
6SE NAME :ABHIJIT BHANDARIWorked With :ZSMManager:Sk.REJAUL BARI
7
8Area Worked 1:RUPNARAYAN PUR
9CallMor EveDr.NameSPECMCL NOP1P2P3INPUTCHEMISTPOBSTOCKISTS
101  
112  
123  
134  
145  
156  
167  
178  
189  
1910  
2011  
2112  
2213  
2314  
2415  
250
26Area Worked 2:
27CallMor EveDr.NameSPECMCL NOP1P2P3INPUTCHEMISTPOBSTOCKISTS
2816  
2917  
3018  
3119  
3220  
3321  
3422  
3523  
3624  
3725  
380
39Area Worked 3:
40CallMor EveDr.NameSPECMCL NOP1P2P3INPUTCHEMISTPOBSTOCKISTS
4116EVE  
4217  
4318  
4419  
4520  
460
47END OF REPORT
60
61
1
Cell Formulas
RangeFormula
D4D4=TP!$B$7
I4I4=TP!$C$7
L4L4=TP!$D$7
C6C6=TP!$E$4
K6K6=IFERROR(VLOOKUP($G$6,'DATA CALCULATIONS'!$N$3:$O$5,2,0),"")
D41:D45,D28:D37,D10:D24D10=IFERROR(VLOOKUP($C10,DR_LIST!$I$2:$L$121,4,0),"")
E41:E45,E28:E37,E10:E24E10=IFERROR(INDEX(DR_LIST!$C$2:$C$121,MATCH('1'!$C10,DR_LIST!$I$2:$I$121,0)),"")
C25C25=COUNTA(C10:C24)
C38C38=COUNTA(C28:C37)
C46C46=COUNTA(C41:C45)
Cells with Data Validation
CellAllowCriteria
F8List=OFFSET(MASTER!$D$2,1,MATCH($C$6,MASTER!$D$2:$S$2,0)-1,15,1)
F26List=OFFSET(MASTER!$D$2,1,MATCH($C$6,MASTER!$D$2:$S$2,0)-1,15,1)
F39List=OFFSET(MASTER!$D$2,1,MATCH($C$6,MASTER!$D$2:$S$2,0)-1,15,1)
G6List='DATA CALCULATIONS'!$N$3:$N$5
F10:H24List=MASTER!$U$3:$U$11
F41:H45List=MASTER!$U$3:$U$11
F28:H37List=MASTER!$U$3:$U$11
B10:B24List='DATA CALCULATIONS'!$R$3:$R$4
C10:C24List=OFFSET(MASTER!$E$2,1,MATCH($F$8,MASTER!$E$2:$S$2,0)-1,COUNTA(OFFSET(MASTER!$E$2,1,MATCH($F$8,MASTER!$E$2:$S$2,0)-1,90)),1)
B41:B45List='DATA CALCULATIONS'!$R$3:$R$4
C41:C45List=OFFSET(MASTER!$E$2,1,MATCH($F$39,MASTER!$E$2:$S$2,0)-1,COUNTA(OFFSET(MASTER!$E$2,1,MATCH($F$39,MASTER!$E$2:$S$2,0)-1,90)),1)
B28:B37List='DATA CALCULATIONS'!$R$3:$R$4
C28:C37List=OFFSET(MASTER!$E$2,1,MATCH($F$26,MASTER!$E$2:$S$2,0)-1,COUNTA(OFFSET(MASTER!$E$2,1,MATCH($F$26,MASTER!$E$2:$S$2,0)-1,90)),1)
J28:J37List='CHEMIST LIST'!$B$2:$B$101
J10:J24List='CHEMIST LIST'!$B$2:$B$101
J41:J45List='CHEMIST LIST'!$B$2:$B$101
L10:L24List='CHEMIST LIST'!G$2:G$7
L41:L45List='CHEMIST LIST'!G$2:G$7
L28:L37List='CHEMIST LIST'!G$2:G$7






PROJECT (Repaired).xlsx
DEFGHIJKLVWX
1CODE NOHQFIRST NAMEMIDDLE NAMESURNAMEFULL NAMEGENDERAREASPECVISIT DATESVISIT DATESVISIT DATES
25ASANSOLSUNILGUPTASUNIL GUPTAMALEASANSOLGENERAL PHYSICIAN
31ASANSOLSIDDHARTHABANNERJEESIDDHARTHA BANNERJEEMALEASANSOLPHYSICIAN/CARDIOLOGIST
41ASANSOLJN.P.KBANNERJEEJN.P.K BANNERJEEMALEASANSOLPHYSICIAN/CARDIOLOGIST
55ASANSOLN.KDuttaN.K DuttaMALEASANSOLGENERAL PHYSICIAN
68ASANSOLR.KGUPTAR.K GUPTAMALEASANSOLDERMATOLOGIST
71ASANSOLATISHSARKARATISH SARKARMALERANIGUNJPHYSICIAN/CARDIOLOGIST
88ASANSOLSHYAMALSANYALSHYAMAL SANYALMALEASANSOLDERMATOLOGIST
91ASANSOLSUBHADEEPGHOSHSUBHADEEP GHOSHMALEASANSOLPHYSICIAN/CARDIOLOGIST
105ASANSOLA.KPODDARA.K PODDARMALEBARAKARGENERAL PHYSICIAN
117ASANSOLA.KROYA.K ROYMALEASANSOLDENTIST
125ASANSOLA.KSONTHALIYAA.K SONTHALIYAMALERANIGUNJGENERAL PHYSICIAN
135ASANSOLN.KKALOTIAN.K KALOTIAMALERANIGUNJGENERAL PHYSICIAN
141ASANSOLJ.NMODOKJ.N MODOKMALERUPNARAYAN PURPHYSICIAN/CARDIOLOGIST
151ASANSOLPKARMAKARP KARMAKARMALERANIGUNJPHYSICIAN/CARDIOLOGIST
165ASANSOLP.SBANNERJEEP.S BANNERJEEMALEASANSOLGENERAL PHYSICIAN
171ASANSOLSTHAKURS THAKURMALEASANSOLPHYSICIAN/CARDIOLOGIST
181ASANSOLSUMANJITCHOWDHURYSUMANJIT CHOWDHURYMALEKULTIPHYSICIAN/CARDIOLOGIST
194ASANSOLJ.BHAZRAJ.B HAZRAMALEASANSOLENT
201ASANSOLKALYANMONDALKALYAN MONDALMALEASANSOLPHYSICIAN/CARDIOLOGIST
211ASANSOLS.KBANNERJEES.K BANNERJEEMALEASANSOLPHYSICIAN/CARDIOLOGIST
DR_LIST
Cell Formulas
RangeFormula
I2:I21I2=DR_LIST!$F2&" "&DR_LIST!$G2&" "&DR_LIST!$H2
L2:L21L2=VLOOKUP(DR_LIST!$D2,'DATA CALCULATIONS'!$C$3:$D$12,2,0)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Please help me with VBA code for Sheet lock and Date Stamp
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,987
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top