Link to home
Start Free TrialLog in
Avatar of Jase Alexander
Jase AlexanderFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to insert two pieces of Visual Basic code into the same workbook / worksheet

Hi Guys

I know Im really slow when it comes to things like this as im not a programmer - I just ask you guys for help

I have a spreadsheet and I want to insert two pieces of code (from here actually) - one that auto colours cells when a certain letter is inserted - this is in and working great, but I have another that I need to insert into the same sheet that performs another function.

Can you help

Much appreciated

Jase
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Just copy and paste the two chunks of code into the same module - one after the other. They can both co-exist in the same module at the same time as long as they don't share the same routine name.

Kevin
Avatar of Jase Alexander

ASKER

Thanks for the reply

I have two routines which both start with Private Sub Worksheet_Change but when I try and enter them in the same module, it gives me an Ambiguous Name Error or something - is there a way around this?

Cheers
Jase
ASKER CERTIFIED SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Fab !!

Thanks for the quick response