VBA - Disable Form Checkbox In Worksheet

Jan 18, 2013

I want to have a Checkbox (Form) that is in my Worksheet to disable/gray-out once it is selected. I don't want people to be able to uncheck it again. I want them to be forced to click another Checkbox to enable it again.

Example:

Two Checkboxes:

Check Box 1 = "Apply"
Check Box 2 = "Delete"

Once "Apply" is checked, gray it out. This will force a user to click "Delete" in order for the "Apply" button to be enabled again. I do not want a user to click "Apply" once selected as their way of 'deleting' the information.

View 1 Replies


ADVERTISEMENT

Disable Checkbox In VBA

Oct 6, 2009

I have a sheet with a number of checkboxes, and I need to conditionally enable/disable some of them.

For example, if the user checks Box1, then the question for Box2 becomes relevant and Box2 becomes available. If Box1 is unchecked, Box2 needs to be unchecked and disabled.

View 9 Replies View Related

Enable / Disable Checkbox With VBA If Statement?

Dec 27, 2013

I have 3 checkboxes on a worksheet. I have a command button to copy/paste data that is captured from a device.

I want the data to go to the ranges that are selected by referring to the true/false driving mechanism of the check boxes.

Obviously if more than one button is checked at one time, the whole shooting match will blow up.

So....how can I allow only one check box to be active at any given time? I'm thinking perhaps a select case statement that refers to the possible conditions of true true true, true true false, true false true, etc....If that would work, how could the code be simplified?

Let's call them cb1, cb2 & cb3. Is this even possible??

View 5 Replies View Related

Checkbox To Enable/Disable TxtBox1

Feb 12, 2009

how to make txtBox1 only useable when optButton1 has been selected only.

I have 4 Textboxes
txtBox1
txtBox2
txtBox3
txtBox4

The following Option buttons are within a Frame called fraFrame1
optButton1
optButton2
optButton3
optButton4

View 9 Replies View Related

Disable & Enable ListBox Via CheckBox

Jun 21, 2008

I have a checkbox (checkbox1) on a userform that functions to disable two listboxes (monthListbox & yearListbox) when checked. For this, I have the following

Private Sub CheckBox1_Click()
MonthListBox.Enabled = Not CheckBox1
MonthListBox.BackColor = &H8000000B
MonthListBox.Locked = True
YearListBox.Enabled = Not CheckBox1
YearListBox.BackColor = &H8000000B
YearListBox.Locked = True

End Sub

This works fine and dandy. However, when testing the userform, when I "unchecked" the checkbox, it did not undo the actions. So my question is, is there a sub to undo the actions that the above code does after I "uncheck" the checkbox. Additionally...under what event would I write this sub since I've already completed the sub for Checkbox_Click()

View 3 Replies View Related

Enable/Disable A Range Based Upon A CheckBox

Oct 23, 2008

I am attempting to modify a spreadsheet so that it will enable a range on Sheet3 (I9:K42) if a check box is checked on Sheet2. If it is not checked, it will lock that range on Sheet 3 and grey (or gray, if you prefer) out that range.

View 9 Replies View Related

How To Disable The X On A Form

Mar 18, 2008

i know in VB6 i could disable the X in the corner so someone can't X out of my form, and i see that's not an option in VBA.

So how can i stop the form from terminating when the user clicks that? i want them to be forced to use one of my buttons to close out and finish.

i tried adding something simple like Exit Sub to the Userform_Terminate() sub, but nothing. i can make code run when they click that, but i can't stop it from closing. what to do?

also, the form is being called by macro that does alot of other stuff before and after the form, so just opening a new instance of the form won't help unless you can stop my other code from continueing until the form is actually done...

View 9 Replies View Related

Multiple Checkbox Form

Feb 26, 2014

What I essentially need to do is the following:

In Column J of my spreadsheet I have a heading of "Documents outstanding"

In the cells below this heading I would like multiple checkboxes that the user can tick or un-tick as the documentation is received.

For example

Passport []
Drivers Licence []
Bank statement []
Utility Bill []
Signed contract []

Now the problem I have is that I am able to make individual checkboxes for these, it becomes cumbersome in a large spreadsheet.

If I could get these options on a single form that I could repeat down the spreadsheet that would be perfect.

The form has to be contained within a single cell.

Is this possible?

View 1 Replies View Related

Disable Form Button

Mar 27, 2008

I have a macro associated to clicking a form button.

If possible, if a certian cell value is equal to 0, I want to diable this button. I do not wish for theuser to be able to run the macro associated with that button click.

If found something similar, but in my case, I cannot find the equivalent to CommandButton1, if that's even what I'm using.

If Worksheets("SHEET").Range("A1").Value = "" Then
CommandButton1.Enabled = False

View 9 Replies View Related

Disable Form Close

Dec 13, 2006

Is there any easy way to disable the close (X) button at the top right of a form.

I've been trying...

Private Sub UserForm_Terminate()
UserForm1.Show
Unload UserForm2
End Sub

but i get a problem when re-opening the userform2??

View 2 Replies View Related

Run Macro When Form Control Checkbox Changes

May 30, 2013

I have many Form Control Check Boxes that all link to another sheet on row 3.

I have many changes to make but only want to implement the change related to the check box.

This code works perfect when you manualy type true or false on row 3 but not if the check box makes the change.

Private Sub Worksheet_Change(ByVal Target As Range)
ThisCol = Target.Column
If Target.Row = 3 Then
RESULT = MsgBox(Cells(1, ThisCol) & " = " & Cells(3, ThisCol), vbOKOnly, "CLICK RESULTS")
End If
End Sub

Why does this not work when a check box changes the value in row 3?

View 5 Replies View Related

Disable Pages In User Form?

Jan 23, 2010

I have a user form with four pages. I would like to disable pages 2 and 3 if the checkbox on page one is cheked. I know the pages have a property called "Enabled" but i can't figure out how to code this.

The user form is called frmAnvilProgNew
The pages are called Page1, Page2, Page3, and Page4
The checkbox is called Check1

see the attached workbook. Is this possible? Should I be using tabs instead of pages?

View 2 Replies View Related

Enter Form Details Into Different Sheets On Checkbox Value

Nov 30, 2009

I've got one more problem to solve with my current project. An example of the workbook is attached.

What i want to do is change the code on my 'enter button' of the 'input form' which can be shown by clicking the 'Add New Hedge' button on the summary sheet.

The change i want to make is when the user clicks 'enter', if the 'settle now' checkbox is false to add the details of the form to the unsettled hedges form as it currently does.

If the 'settle now' checkbox value is true then i want the form details to be added to the next available row on 'settled hedges' worksheet, in the same way it currently does for adding into the next available row of the 'unsettled hedges' sheet. Also here, i would want the value of the 'returns' textbox added to be added into column L rather than the text "unsettled". This would also mean when the 'settle now' checkbox is true that the 'returns' textbox needs to have a value before adding any details.

View 15 Replies View Related

Code For Simple Checkbox On User Form.

Jan 21, 2010

I really don't know how to code a checkbox correctly. On the sheet, I have a form with CheckBox1 and Checkbox2. I would like Checkbox2 disabled until Checkbox1 is checked. Also, when Checkbox1 is checked, display Image1, otherwise Image1 is hidden. When CheckBox2 is enabled and checked, display Image2, otherwise Image2 is hidden. I know this is real beginner stuff, I'm still a rookie.

View 4 Replies View Related

Remove Checkbox Ticks From Last Use Upon Opening User Form

Jun 2, 2009

I am simply trying to write a macro or code that will set all the check box values to "False" each time I initiate the User form. So that the user form does not "carry over" check box values from the last time the User form was used.

However I had to make sure I cleared the value from the cell that each control is associated with.(the controlsource in the user form properties.)

View 9 Replies View Related

Excel 2007 :: Clicking Checkbox In Oracle Form Using VBA

Jun 7, 2012

One of my engaging tasks at work is to disable/enable general ledger accounts (accounting speak) in our Oracle ERP application using one of their forms.

In this case it would be a list of gl accounts and to the left of the gl account would be a check box that I can click.

Checked means enabled.
Blank would mean disabled.

If I have a list of currently enabled gl accounts that are to be disabled (unchecked) then I have to do so one by one. I can click with the mouse on the checkbox or I can using the keyboard use the space bar followed by the down arrow key and repeat. As fun as that sounds sometimes I'm faced with dozens or hundreds at a time.

Therefore my question is can I automate this using VBA? or any other tools out there.

Using Excel Office 2007, Oracle ERP (9.5.8) I think - it's old

View 1 Replies View Related

Checkbox Form Control Application Caller When Grouped

Aug 27, 2012

I have coming from the Forms Controls within a Sheet 6 CheckBox.

for the following countries: "Spain", "France", "UK", "Italy", "Germany" and "EUROPE"

when Europe is selected the I select all the Check Boxes at once by Macro, if Europe is selected and I unselect Europe, then I unselect all the countries by Macro.

When Europe is selected and then I press for eg in Spain, the Spain is not selected and then I unselect Europe, by macro.

This works fine, and my macro does the job OK.

Code:

Sub mCountries()
On Error Resume Next: Application.ScreenUpdating = False
Dim wCaller As String: wCaller = Application.Caller
Dim aCheckBoxes(): aCheckBoxes = Array("cBoxSpain", "cBoxFrance", "cBoxItaly", "cBoxGermany", "cBoxUK")
Dim X As Long: X = -4146
Dim Y As Long

[Code]....

But if My 6 CheckBoxes are grouped... the Macro does do the job How can I refer to a shpes withing the Grouped Shape to apply the selection and/or to unselect??

View 4 Replies View Related

Enable Disable Form Controls Based On Criteria

Oct 20, 2007

I am creating a form that performs several different functions. I would like to force a sequence of these functions by enabling/disabling the controls based on a variable.

For example, a form as two buttons Button1 and Button2. By default, Button1 is ENABLED and Button2 is DISABLED. When Button1 is clicked, a macro is run, where an Enable_Button2variable is initialized to FALSE. The last line of the macro sets the Enable_Button2 variable to TRUE. Then, because Enable_Button2 is now TRUE, Button2 then becomes ENABLED.

I am trying to apply this strategy to a ComboBox, ListBox and CommandButtons. I'm not sure what event to trigger on to poll the Enable_Button2 to enable/disable the control.

View 3 Replies View Related

Change Form Checkbox Fill Color For ALL Checkboxes In Workbook When Checked (True)

Nov 20, 2013

I have a multi-worksheet workbook that has many forms control checkboxes throughout it. I'm looking for some VBA that will change the background (fill) color of ALL the checkbox when it is checked (True). I've seen code for a single checkbox, but not multiple/all boxes. I know just enough VBA to be dangerous, but I'm up to learning anything new.

View 3 Replies View Related

Excel 2010 :: VBA To Change Form Control Checkbox Background Color When Checked

Nov 22, 2013

I have an Excel 2010 workbook with many worksheets using hundreds of Form Control (not ActiveX) checkboxes. I need a bit of VBA to change Checkbox background color of each checkbox whenever the user checks the box. I assume this needs to be a click event? I don't even know the Checkbox property name I need to change I'm learning VBA as quick as I can

View 4 Replies View Related

Get State Of Checkbox On Worksheet

Jan 14, 2009

I need to get the state (xlon or xloff) of check boxes on a worksheet. i have tried the following but unable to get it to work.

View 3 Replies View Related

Disable Printing Of A Worksheet

Feb 20, 2007

I have a workbook of some 15 worksheets - however there is just one of the worksheets I want to disable the printing of it. So that when users select print whole document - all worksheets will print except for thus one worksheet

The worksheet tab is named "15.ADMIN WORKBOOK CONTROL ONLY"

I know I need to put some vba code into the code area of that worksheet

I tried this code but it didnt work

Private Sub Worksheet_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

View 9 Replies View Related

Disable Worksheet Button

Jul 27, 2007

I have buttons on each of my sheets, when one is clicked code is called in my module ("modAPI"), and from that code I wish to disable and enable certain buttons, and/or change the caption of those buttons. However when I try to do:

With ws
btnRefresh.Enabled = False
End With

I get Error 424, Object Required. I've tried recording a macro of what I wish to do, and it gives me ActiveSheet.Shapes("btnRefresh").Select, but this doesn't give me the option to enabled/disable or change the caption of the button.

View 3 Replies View Related

Check Value Of Checkbox On Worksheet

Dec 14, 2007

I have a problem to check the value of a checkbox when I write the code in Module1. I have several worksheets, and in each worksheet there is a CheckBox1. I want the macro (in Module1) to perform a given code when the CheckBox1.value = true and visa versa.

The code I'm using is as follows:

Option Explicit

Global ws As Worksheet

Application. ScreenUpdating = False

For Each ws In Worksheets

If CheckBox1.Value = True Then
'Do code1
Else
'Do code2
End If
Next ws

Application.ScreenUpdating = True

End Sub

When the Macro is run, an error msg is showing "RunTime error '91'.

Does anyone know how to make this macro function? I've searched the forum, but couldn't make any of the codes suggested to work.

View 3 Replies View Related

Unchecking Checkbox In Separate Worksheet Using VBA

Jan 4, 2013

I have a workbook containing many different sheets. What I want to accomplish is when I click on a check box on one sheet, I want the check box in a different worksheet to be unchecked. I have form control checkboxes in my workbook, so I used xlOff as the value.

Here's what I have in my VBA code.

Worksheets("February").CheckBoxes("CheckBox13").Value = xlOff

It is giving me the error "Unable to get the CheckBoxes property of the Worksheet class"

View 4 Replies View Related

Transfer Checkbox Caption To Different Worksheet?

Jul 1, 2014

I have 71 checkboxes that I want to transfer the Checkbox Caption if true. If the checkbox is false I want to transfer a value of "0". The captions are being transferred to a different worksheet. Below are a few entries if I was to enter them all separately, but I assume there is a way to do all at once?

View 4 Replies View Related

Worksheet CheckBox (Hide Unhide)

May 22, 2009

I am having difficulties with this one. I have a button on my worksheet (sheet1) that runs a macro.

View 4 Replies View Related

How To Disable Worksheet Functions Within Out Protection

Jun 19, 2009

I have a spreadsheet which has extra worksheets at the end that the user can move around, if they need them.

Then i found out that users were adding there own sheets, so i protected the workbook, but i found out that this stops the user from moving the sheet.

Whats the easiest way probably using code to disable the worksheet functions, ie the ones that appear if you click on the tab (insert,delete,rename,move+copy,select all sheets etc) but still allow the user to move the sheet within the workbook

View 7 Replies View Related

Disable Close (X) On Specific Worksheet

Jan 9, 2010

I have a pivot table that's made visible from a "Drill Down" button on the source worksheet.

View 4 Replies View Related

Hide / Disable Worksheet Menu Bar - !

Feb 27, 2007

Is there a way to either hide or disable the worksheet menu bar on ONE SHEET ONLY, so that a right-click customize doesn't even work on that sheet. I want the user to be able to do nothing but what my customized toolbar allows on that sheet.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved