Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Excel


Advertisements:










Disable Checkbox In VBA


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 Complete Thread with Replies

Sponsored Links:

Related Forum Messages:
Checkbox To Enable/Disable TxtBox1
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 Replies!   View Related
Enable/Disable A Range Based Upon A CheckBox
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 Replies!   View Related
Disable & Enable ListBox Via CheckBox
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 Replies!   View Related
Checkbox Vba: The Amount From The Subtotal Cell Will Auto Go To The Cell Next To The Checkbox
I have been using different keywords to find what I need. I have 3 checkboxes: cash, amex, other. I have a subtotal cell. When the appropriate checkbox is checked, the amount from the subtotal cell will auto go to the cell next to the checkbox. Is this VB?

View Replies!   View Related
Disable The Vba In A File Being Opened Using Vba
I have excel vba code to open .xls files on my server. Files to open are chosen by the user via a UserForm within my app, it shows them all their files in their directory on my server. How can I open their files (.xls) that they select but DISABLE the VBA from being able to run/execute, if they have any attched to the file?

I now have all code in place to open the file no problem, I just need to know how to disable the VBA part from being "turned on" when the file opens.

View Replies!   View Related
Check The Value Of A Checkbox In VBA
I'm trying to check the value of a checkbox that I created in my workbook, but both of the if statements below say "Object does not support this property or method"

View Replies!   View Related
Refer To A Checkbox Value By Vba
I have a check box whithin a worksheet. This CheckBox doesn't have any linked cell, and doesn't have any macro asigned. know I would like to refer to the value of the checkbox by vba kind of: ?ActiveSheet.Shapes("CheckBox1").value=true 'from the vba's inmediate window

View Replies!   View Related
Command For Checking A Checkbox In VBA
I have a worksheet with a series of checkboxes. I'd like to run a macro that would check SOME of them and then uncheck them.

I tried recording the macro first, but the recording did not recognize me checking the checkbox. I also tried writing a VBA script that would add a space (" ") to that checkbox and that seemed to work but not optimal for adding the check makrs back in.

View Replies!   View Related
Checkbox Creation - Vba Code
I just realized that after create 1200 checkboxes using VBA then excel will prompt an error. Something like object automation bla...bla....bla. What Is the shortest code with VBA to create 2000 checkboxes? I run copy paste function with VBA but seems not working well.

View Replies!   View Related
How Do You Disable Or Delete A Button In VBA
How do you disable or delete a button in VBA code after the button is pressed?

View Replies!   View Related
Disable Macros On Opening Using Vba
I have created an Excel template that the company sends out to suppliers to provide us with Quotations. I've added some VB in the Before Save module to prompt the user to do certain things. The problem I have is that I run another procedure that loops through a list of data and re-formats it using the template and therefore every time it tries to save a file the Before Save prompt pops up.

View Replies!   View Related
Select/Tick/Check A Checkbox Via Vba Code
How do i check a checkbox on an excel worksheet?

View Replies!   View Related
Disable Or Lock The Button In The Attached File By Using Vba
How can i disable or lock the button in the attached file by using vba?

View Replies!   View Related
Auto-disable Macros Opening Workooks Via VBA
I have to open some woorkbooks via VBA disabling macros automatically (the reason of this is very hard to explain, my boss wants it in this way)

Does any parameter exist to add it to the woorkbook.open function? or any trick to do this?

View Replies!   View Related
Disable Save Query Definition Option Vba
I want to be able to disable the save query definition option for a worksheet using VBA. Right now I have to right click a cell and then go to Data Range Properties and then uncheck the save query definition box. If there is a way to automate this that would be great.

View Replies!   View Related
Checkbox : Married, Widows, Single Checkbox Is Selected
married, widows, single checkbox is selected

macro solution
good work.

View Replies!   View Related
Hide/Unhide Checkbox Using Another Checkbox
How can i hide and unhide one checkbox using another one? Can it be done using IF formula?
And also i am using this checkbox to function something else as TRUE/FALSE.

View Replies!   View Related
How To Disable #N/A
I have this following codes on cell G6

=VLOOKUP(G5,'P1'!K133:L135,2)

i want it to show an empty cell instead of #N/A if it returns 0 value...

View Replies!   View Related
Turning On A Checkbox
I want to turn on (tick) a check box from within a macro.


View Replies!   View Related
Use Of Checkbox On Userform
Can it be made in VBA as follows:

I have made a userform with the initialize routine. On this there are checkboxes which I would like to be selected for a YES.

When the YES (checkbox) is being selected I than would like to see in the active userform an already made and "hidden" textbox to enter a value for confirmation of a quantity to order.

I have been loking for some sort of Private Sub Userform Change() routine, but can not find this type of routines

View Replies!   View Related
Select All Checkbox
I have 20 check/tick boxes on my worksheet (CheckBox1-20), each of the 20 tickboxs has its own linked cell A1-A20 - I wish to have another checkbox (checkbox21) that, when ticked will tick all of them.

Also, if unticked it will untick the 20. I'd like this to be a kind of "onclick" command - so that if I wanted to tick 5 of the 20 on their own, the "master" tick box won't interfere with this. If a command button is easier to code than this is just as good.

I've been looking online on on here for the last 2 hours with no joy, not even getting close.

I am using Form Controls rather than ActiveX controls.

View Replies!   View Related
Checkbox At Chart
i want to create a chart ,the chart have a checkbox beside it.
so i can check which line to display....
example
test1 (group112data,group113data)
test2 (group112data,group113data)

then the chart selection is to select 1 then it will diplay group112 result (test 1 and test2),this is to make comparison

can i do it for normal chart?
or must use pivot chart?

View Replies!   View Related
Checkbox Reference...
Checkbox reference. I am using the following code

View Replies!   View Related
Checkbox Event
I need to have a check box, that when it is checked the user must fill in a cell.

View Replies!   View Related
How To Disable The X On A Form
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 Replies!   View Related
Disable The X Button
I want to disable the X button on the top right hand corner in excel, but still allow the user with the option of closing the workbook via File and then scrolling down to EXIT. (Not close). I have disabled most of the functions in the Menu bar Close being one of them.

So only Exit is now enabled. When I click on the X it give me the following message as shown below advising me to go to the File menu to Exit, this bit I am happy with. However this is were my problem begins, when I go to File and Exit I get the same message as below and can not exit the application.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
MsgBox "Please select EXIT from the File Menu.", vbCritical, "Cannot Close"
End Sub


View Replies!   View Related
Disable CMB_Change
I'm running a module macro which cause a CMB change (and an additional macro run) in one of the sheets.

Since this interrup the main macro run (and also waste unnecessary time) I would like to disable it.

View Replies!   View Related
Disable Right Click. Can It Be Done?
Need code or way of disabling the Right Click feature in Excel? I think you can change it in the computer settings but I only want to disable it for a particular workbook so I am hoping there is a VBA Code that will tell the user "Right Click Not Allowed, Please use Cut and Paste or Ctrl +V and Ctrl +C"


View Replies!   View Related
Disable A Button
I have a button on excel form. I need to disable it once user has clicked on it.

I couldnt find name of it on the form anywhere or how to refer it to in the macro.

View Replies!   View Related
Disable Comments
I am sure this can be done - I found a similar thread but in a different context to what I need.

I have a user of a workbook who insists on putting irritating red cornered comments in cells, rather than using the handy (and rather large) comments field I put in, especially for her.

View Replies!   View Related
Way To Disable Help Feature
I just want to know if there is anyway to disable the help feature in Microsoft Excel?

I have to administer some exams.

View Replies!   View Related
Disable ClearContents
I found this great code on this forum to disable copy/paste.

I would like to also disable ClearContents..

I can gather from the code that I just need to add a line similar to
EnableControl 755, False ' pastespecial

but change the # for the clearcontents command. But How can I find that number?

Sub DisableCopyCutAndPaste()
EnableControl 21, False ' cut
EnableControl 19, False ' copy
EnableControl 22, False ' paste
EnableControl 755, False ' pastespecial
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "+{DEL}", ""
Application.OnKey "+{INSERT}", ""
Application.CellDragAndDrop = False
Application.OnDoubleClick = "Dummy"
CommandBars("ToolBar List").Enabled = False
End Sub

View Replies!   View Related
Disable Sorting
I would like to be able to disable a workbook from being able to be sorted, but at the same time allow fitering.

I have tried the following code, but have not got it to work correctly, does any one see what I need to add or remove to get this to work.

Option Explicit

Private Sub Workbook_NewSheet(ByVal Sh As Object)

With Application
. ScreenUpdating = False
.DisplayAlerts = False
ActiveSheet.Sort
MsgBox "You Can't sort sheets in this workbook!"
.DisplayAlerts = True
.ScreenUpdating = True
End With

End Sub

View Replies!   View Related
Msgbox Disable X
i have this code to disable X in a MsgBox.......

MsgBox "Closing from X is Disabled", 20, "Action"

Is there another way that the MsgBox shows OK only botton without showing yes/no botton

View Replies!   View Related
Disable Mouse
Is it possible prevent the use mouse (disable mouse) while a macro is running? I made a program which starts with animation of Shapes. If you click on shape while macro is running it stops animation.

View Replies!   View Related
Keyboard Disable
Does anyone know if there is anyway that we can command Excel to avoid accepting aNY KEYBOARD ENTRIES? what intend to do is restrict a certain region on a worksheet for Users not to be able to type anything but but there are commandbuttons on the header which use: Range("C65536").End(xlUp)(2, 1) = "Value for the last cell" code to get the input into the cell. The purpose is to make use of the cmdbuttons with mouse but the data notto be keyed in !!!

View Replies!   View Related
Control Data With A Checkbox
Not sure if this can be done, when I enter data for a journal only the data with the box checked is entered? I hope my example shows what I mean.

View Replies!   View Related
Checkbox To Show A Certain Sheet.
I have a query Work sheet that has the names of my worksheets in the following format.. mmm dd, yyyy H15 has a formula that returns the sheetname as a value. What Id like to have is a checkmark that when checked it will take you to that worksheet. Ive played with it and came up with the following...but its not working...any advise??

Sub SHOW_H15()
'
Worksheets("Query").Range("H15").Text .Select
End Sub
Also id like to have the check mark named as "Would you like to see (h15) 's worksheet?"


One more thing...if a value is in H15 Id like the checkmark box to appear. If nothings in H15 dont show the checkmark Box.



View Replies!   View Related
Value Of Cell To Return To Checkbox
I'm trying to achieve a search of a sheet using a selection in a listbox on my userform and then return a value of 'true or false' to my checkbox.

My code is below;

With Sheets("JobChecklist")
Set r = .Columns("b").Find(Me.ListBox3.Text, , , xlWhole)
If r Is Nothing Then

Exit Sub
End If
ff = r.Address: n = 0
Do
n = n + 1
ReDim Preserve a(1 To 6, 1 To n)
For i = 1 To 3
a(i, n) = r.Offset(0, 1).Value
Next
Set r = .Columns("b").FindNext(r)
Loop Until ff = r.Address
End With
With Me.CheckBox30
If a.Value = True Then
CheckBox30.Value = True
Else
CheckBox30.Value = False
End If
End With
End Sub

View Replies!   View Related
Turn Off Vlookup With A Checkbox
Not sure if this can be done. Here is a example of my project

View Replies!   View Related
Dynamic Checkbox Array
I have a workbook that launches a form for a user to confirm (or un-confirm) some data retrieved from an Access database. I would like to put the "confirming" aspect of the process into a checkbox array. The recordset can return anywhere from 1 to around 12 records. I would like to add the checkboxes on the fly based on how many records were returned. Anyone have some sample code to show me how to add these to the form at run time?

View Replies!   View Related
IF Function Using Embedded Checkbox
I need to create a formula that will calculate a total if someone checks a certain box. (Each check box is associated with a cost. When people check the correct costs, the bottom should total the costs checked.)

View Replies!   View Related
Checkbox Text To The Left
How can you make the text of a checkbox appear on th left hand side of the checkbox?

or can it only appear onthe right?

else is there a way to make the text box not exist or invisible,

Its just that I have infomation underneath and I need to be able to access it?


View Replies!   View Related
Set Checkbox In The Next File
Create a macros, which sets any checkbox in the next excel file
fist link
http://narod.ru/disk/12388811000/car_test.xls.html
or another link of the same file
http://rapidshare.com/files/271305333/car_test.xls
I can't find the name of any checkbox.

View Replies!   View Related
UserForm CheckBox That Will Print
On my excel 2007 UserForm I have a CheckBox with 18 possible or multiple selections of reports (word.docm)
what I would like to do is, when selected they would be sent to printer.

Here's what code I have so far, something is missing, I'm not sure

Private Sub CommandButton2_Click()
For x = 1 To 18
If Controls("checkbox" & x) Then
Select Case x
Case x = 1
worddoc = ActiveWorkbook.Path & "Inspection ReportsCover Page.docx"
Case x = 2
worddoc = ActiveWorkbook.Path & "Inspection ReportsClient Information.docx"
Case x = 3.....................

View Replies!   View Related
Selection Of 1 Out Of Multiple Checkbox
In one of the worksheet. I have list of questions in column A.

In column B I want to have the following 3 checkbox

1> YES
2> NO
3> Not sure.

Based on the question, user selectts one of the check box.

User should not be able to select multiple checkbox. i.e. User can select only 1 out 3 possible options.

View Replies!   View Related
Code To Deselect Checkbox
Can code be written to deselect a checkbox.

Something like:
Deselect.checkbox1 = TRUE
Or maybe execute code using code

If Range("C1").value = TRUE then
MakeWide
Else
EndIf
I have the MakeWide Macro attached to checkbox1

Will this actually physically change the checkbox? to select/deselect?

View Replies!   View Related
Error When Reading Checkbox Value
I have a spreadsheet with about 200 lines or records and I have added a checkbox to the end of each record. I need to the code to check the checkbox on each line to make a decision on how to process the data, but I do not want to read in a True or False value for 200 check boxes in every step of the loop. I think I'm close but I can't get the following to work...

This is basically what I want:

For i = 1 to x Step 1

IF me.Shapes("Checkbox" & i).Value = True Then

'Perform Action

END IF

Next i
I get an error when I hit the IF me.Shapes..... line

"Object doesn't support this property or method."

View Replies!   View Related
Changing The Value Of A Checkbox Programatically
Is it possible to change the value of an Excel checkbox (from Forms or Control Toolbox) under program control (i.e. using VBA)?

I'm trying to toggle a group of checkboxes on a worksheet from FALSE to TRUE (or back again) using a single button. The checkboxes all have to remain individually selectable by the user even after 'toggling'.

View Replies!   View Related
Should I Use A Radio Button Or Checkbox
I'm making a worksheet where the user has the options to select "yes" or "no". I used active x radio buttons because I feel they are more flexible. The problem I'm running in to is, what happens if there is an "unknown"? I can't find a way to "deselect" a radio button?

I tried using 2 checkboxes using the following
Checkbox 1:

If CheckBox2.Value = True Then
CheckBox1.Value = False
End If

Checkbox2:

If CheckBox1.Value = True Then
CheckBox2.Value = False
End If

The problem with this is, you have to deselect one checkbox before you can select the other. It works, but itís a little more cumbersome then I was hoping. Is there a better solution?

View Replies!   View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved