Automatically run vba if cell condition is met

AawwYeahh

New Member
Joined
Aug 10, 2017
Messages
37
Ok so I am currently working on a more user friendly template for invoicing. I have a data validation list to choose from multiple titles and have modified worksheet to act accordingly when "topic" is picked (IE invoice, Service, etc) my problem is I need different cells (all located in same space) with different formulas. I tried writing in formula to replace if condition is met but I lose cell formatting etc. I have recorded 3 macros but am wondering how to execute them without "pulling the trigger" of clicking on control button. And these are 3 separate macros, seem inelegant and messy. I am hoping someone has a better solution.
This is the default page layout (Macro 1)
Sub Macro1()
'
' Macro1 Macro
'

' Sheets('Layout") .Select
Range("A2:O11").Select
Selection.Copy
Sheets("INVOICE").Select
Range("A16:O25").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub

Macro 2 (for Service)
Sheets('Layout").Select
Range("B14:O23").Select
Selection.Copy
Sheets("INVOICE").Select
Range("A16:O25").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Macro 3 (for construction)
Sheets('Layout").Select
Range("A26:O35").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("INVOICE").Select
Range("A16:O25").Select
ActiveSheet.Paste
End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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