Very long macro!!

panyagak

Active Member
Joined
Feb 24, 2017
Messages
299
Hi Mr Excel gurus.

Am "surgically" preparing to come up with JUST ONE LONG MACRO, recording >20 sequence of events to "cut out" tedious manual repetitive tasks.

Wondering the problems I may encounter recording & running it.

Anyone who has successfully created & using a long Macro?

My intention is use THE SHORTEST TIME to achieve my analysis goals.

thanks
panyagak
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
bugger to debug

create 20 small macros and call them one after another, very little over head that way, just be optimal when you create your files
 
Upvote 0
You should split things up into stages, record/create the code for each stage separately and then join everything up.

Also if you are using the macro recorder you'll end up with a bunch of unneeded code so you should regularly review the code that's been generated.
 
Upvote 0
Norie & Mole999

"create the code for each stage separately and then join everything up."

On "joining up", this is where I"ll end up coming back to you guys repeatedly....which i dont want... pasting here 20 codes to join up amid many quizzes!!! am learning vba

Regards
 
Upvote 0
join like this example

SUB ALL
ONE
TWO
End Sub

SUB ONE
your code
End Sub

SUB TWO
your code
End Sub
 
Upvote 0
Patrick

If you want specific help with your code post details of what you are trying to do, otherwise all we can give is general advice.
 
Upvote 0
I have 4 columns of interest: original A B C D & a copy A B C D all with values within one sheet:

am doing sensitivity analysis on the copy:

Add 1 to B & C & hold there:then add 1 to A, add 1 to D: dont mind the formulas are preset for filtering whole numbers only.
Next less 1 from A, add 1 to D;filter only TRUE;create new sheet; copy paste filtered data

Next add 1 to A; less 1 from D

Next less 1 from A; less 1 from D

Repeat for 2 to 5.(both - & +)

NEXT
hold A & D constant: add 1, less 1 & vv then -+2 to +-5 & vv on B & C.

NEXT
hold A & B constant : add 1, less 1 & vv then -+1 to +-5 on C & D & vv.

For all these scenarios, you filter TRUE on 2 preset columns, create a new sheet & paste there & repeat next scenario.

Each scenario (+-1-5) will give me 21 Macros: add 3 others*21 equals 84 & more!!!!

Lord HELP!!
 
Upvote 0
Norie

May be you can advise further on Loops. am not adept at VB - am @learning stage.

Can Excel's What-If help or Solver Add-in?

Regards
Patrick
 
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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