vba coding

dibyendu

New Member
Joined
Jun 16, 2015
Messages
28
Dear sir,
I want auto save(backup) and update my data(every time when I write some thing) of my excel through VBA CODING in different excel located in different location and folder FOR EXAMPLE save my data to excel name "storage" located in D drive in new folder.(exactly to my original data ) Kindly help me out of the problem. The excel to be copied is attached here


Thank you sir

SYMPTOMs ACTIVITY 5. Worksheet 2 - Scoring Criteria for Condition6. Work Sheet 3 - Scoring Metabolic Stress
SL.NO.DATE (B3)NAME (B4)REG.NO (M3)AGE (M4)HEIGHT (C10)SEX (P3)BMI(P4)CW (G9)Kgs1MW (G12)
6MW (G13)FI (T14)All relevant diagnoses (E94)STAGE (E95)TREATMENT (B98)SYM.3.1 (A20)SYM.3.2(A21)SYM.3.3(A22)SYM.3.4(A23)SYM.3.5(A24)SYM.3.6(A25)SYM.3.7(A26)SYM.3.8(A27)SYM.3.9(A28)SYM.3.10(A29)SYM.3.11(A30)SYM.3.12(A31)SYM.3.13(A32)SYM.3.14(A33)SYM.3.15(A34)AC.4.1(K20)AC.4.2(K21)AC.4.3(K22)AC.4.4(K23)AC.4.5(K24)% Wt.Loss (L49)SCC.2.1 (K42)SCC.2.2 (K43)SCC.2.3 (K44)SCC.2.4 (K45)SCC.2.5 (K46)SCC.2.6 (K47)SCC.2.7 (K48)no fever (E58)no fever (E59)no steroids (E60)>99 and <101 (H58)<72 hrs (H59)low dose
(<10mg prednisone
equivalents/day) (E60)
>101 and <102 (K58)72 hrs (K59)moderate dose
(>10 and <30mg prednisone
equivalents/day)
(K60)
>102 (N58)> 72 hrs(N59)high dose steroid
( >30mg prednisone
equivalents/day)
(N60)
PE (S80)PG-SGA RATING (K90)TOTAL PG-SGA SCORE (N97)
114/06/2015S15050157M25.1562650unchanged LY0CTYES000000000000000YES0002YES0000000000000000000A6
218/04/2015S16067152M14.7234350less than usual OC0SUR+CT00YESYES000000YES000Depression00YES001YES0000YES00000000000002C14
318/04/2015S17059163M14.6839400less than usual OE0CT0YESYES00000000000Depression00YES001YES0000000000000000002014
418/04/2015S18028154M17.2941400less than usual OC0SUR+CT00YES00YES00000000Depression00YES000YES0000000000000000001B9
514/06/2015madam12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
614/06/2015sample12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
714/06/2015test12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
814/06/2015LAST12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
914/06/2015BIG12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
1014/06/2015LOOK12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
1114/06/2015END12345/1244160F21.48550000000000000000000000000000000000000000000000Review00
1216/06/2015DNA0000#DIV/0!00000000000000000000000000000000000000000000000Review00

<colgroup><col><col><col><col><col><col><col><col><col span="2"><col><col><col><col><col><col span="8"><col span="6"><col span="5"><col><col span="7"><col span="2"><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Welcome to the Board!

I'd start by recording a macro performing a SaveAs, which will give you the correct file path.

Then you can change it to SaveCopyAs in VBA and call it from a Change event, or just assign the code to a button. To give you some Change event code we'd need to know when it should be triggered. That is changing what range should do it?
 
Upvote 0
There are a lot of things the macro recorder cannot do, but you can get a lot of code from a recording session that you can use in code you want to write yourself.
Want to know how to write code to scroll. Just run a macro and then copy the scroll code:
ActiveWindow.LargeScroll Down:=-1
ActiveWindow.SmallScroll Down:=73
 
Upvote 0
Welcome to the Board!

I'd start by recording a macro performing a SaveAs, which will give you the correct file path.

Then you can change it to SaveCopyAs in VBA and call it from a Change event, or just assign the code to a button. To give you some Change event code we'd need to know when it should be triggered. That is changing what range should do it?

It should triggered as soon as a new subject's data is completed and should be updated automatically by pressing a button.And at the same time the file of the stored excel should not open automatically
Sir, if there is any option to post my excel here so that is becomes easy to understand
Thank you
Dibyendu Sharma
 
Upvote 0
I have done macro recording ... I have entered an entire subject data and some code has appeared in vba . and now I want to copy the entire subject's data into new ms excel situated in different location automatically...... how to do this please guide me...

Dibyendu Sharma
 
Upvote 0
and now I want to copy the entire subject's data into new ms excel situated in different location automatically...... how to do this please guide me...
Dibyendu Sharma

It sounds like you got the first part, so I'd record a macro copying the source data, then opening the destination workbook and pasting it.

Post back the resulting code when you're done.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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