Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2017, 04:01 AM
acmo acmo is offline Button & Macro Help Windows 10 Button & Macro Help Office 2010 64bit
Novice
Button & Macro Help
 
Join Date: Jan 2017
Posts: 1
acmo is on a distinguished road
Default Button & Macro Help

Hi all, newbie here. I have created a simple book for costing purposes at work, fill out each sheet that applies and the final sheet has the outcome filtered to it.
As a default I have the markup on products and materials set to 20% eg (G4*1.2)
What I would really like is a series of buttons on each sheet to give the option of markup percentage


eg button 1 10% (g4*1.1,H6*1.1,K28*1.1)
button 2 20% (g4*1.2,H6*1.2,K28*1.2)
button 3 25% (g4*1.25,H6*1.25,K28*1.25) and so on.....there are multiple cells on each sheet for these buttons to apply to.

I have no idea what I am doing with code but will pick it up if someone can give me a kickstart!!

Thanks in advance
Reply With Quote
  #2  
Old 01-07-2017, 08:27 AM
jeffreybrown jeffreybrown is offline Button & Macro Help Windows Vista Button & Macro Help Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

You could do something as simple as, place three buttons on your worksheet and add three separate codes to your VBA. Assign the buttons to the codes below.

Change the Range to wherever you want the percentage.

Code:
Sub Push_Button_1()
    Range("A1").Value = "1.1"
End Sub
Code:
Sub Push_Button_2()
    Range("A1").Value = "1.2"
End Sub
Code:
Sub Push_Button_3()
    Range("A1").Value = "1.25"
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Button & Macro Help Macro button missing namedujour Word VBA 0 08-25-2014 11:21 AM
Deleting Macro Button mata30s Word VBA 0 01-23-2013 12:04 PM
How do I assign a macro to a button when the macro is in my personal workbook? foolios Excel Programming 2 07-27-2011 02:41 PM
Macro Button B2W Excel 2 06-18-2010 09:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft