Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2015, 12:36 AM
Rodion Rodion is offline Help with Macro Please Windows 7 64bit Help with Macro Please Office 2013
Novice
Help with Macro Please
 
Join Date: Aug 2015
Posts: 2
Rodion is on a distinguished road
Default Help with Macro Please

Hello,



I am new to macros, can some one help me to write a macro for the following task.

Assign a check-box to a cell and whenever the box is checked i wanted the value to be equal with cell (example E5). Whenever the box is unchecked i wanted the cell to be empty or zero.

Is it possible please?
Reply With Quote
  #2  
Old 08-23-2015, 09:03 PM
NoSparks NoSparks is offline Help with Macro Please Windows 7 64bit Help with Macro Please Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

What part of this do you need a macro for?

Put a Form Controls Checkbox on B5
In the check box properties make the linked cell B5. Format B5 text same color as back ground so it's not distracting.
Put formula in C5 =IF(B5=TRUE,E5,"")
Reply With Quote
  #3  
Old 08-24-2015, 12:28 AM
Rodion Rodion is offline Help with Macro Please Windows 7 64bit Help with Macro Please Office 2013
Novice
Help with Macro Please
 
Join Date: Aug 2015
Posts: 2
Rodion is on a distinguished road
Default

Using it for a pricing list. Tick the boxes for product i need.
Thank you, it work
Reply With Quote
  #4  
Old 08-24-2015, 06:46 AM
NoSparks NoSparks is offline Help with Macro Please Windows 7 64bit Help with Macro Please Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

If you have a lot of check boxes to put on your sheet, maybe you can make use of this macro I came across in the forums long time ago.
Play around with it in a blank workbook, it can be handy.
Code:
 Private Sub Insert_Checkboxes()
     Dim myCell As Range
     Dim myRng As Range
     Dim CBX As CheckBox

     With ActiveSheet
         'delete existing checkboxes from sheet, links are not cleared.
         .CheckBoxes.Delete
         'Exit Sub   '<~~~~~ uncomment to delete checkboxes only. Linked cells are NOT cleared.
         Set myRng = .Range("A2:A11")    '<~~~~~ enter the range to have checkboxes
     End With

Application.ScreenUpdating = False
     For Each myCell In myRng.Cells
         With myCell
             Set CBX = .Parent.CheckBoxes.Add _
                         (Top:=.Top, _
                          Left:=.Left, _
                          Width:=.Width, _
                          Height:=.Height)    'click area same size as cell
             CBX.Name = "CBX_" & .Address(0, 0)
             CBX.Caption = "Label goes here"     'or whatever you want
             CBX.Value = xlOff    'initial value unchecked
             CBX.LinkedCell = .Offset(0, 1).Address     '<~~~~~ enter offset to linked cell
         End With
     Next myCell
Application.ScreenUpdating = True
End Sub
Reply With Quote
Reply

Tags
cell, checkbox, macro



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to add title in header is missing text once macro is run shawnee24 Word VBA 3 05-27-2015 12:35 PM
Help with Macro Please Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM
Macro Needed to bold specific lines and Macro to turn into CSV anewteacher Word VBA 1 05-28-2014 03:59 PM
custom icon, undo/redo for macro, permanent macro Rapier Excel 0 08-05-2013 06:30 AM
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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:06 PM.


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