Unclick Code on Check box command button

I have code written that when the control check box is 
selected certain cells will highligh.  I would like for 
those same cells to turn white when the check box is 
unchecked.  What code do I need?  Thanks!

Private Sub CheckBox1_Click()
Range("B17:D17").Select
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
        .Value = 0
        
            
    End With
End Sub
0
anonymous (74722)
9/10/2004 3:06:40 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
428 Views

Similar Articles

[PageSpeed] 56

How about checking if the checkbox is checked or not checked <vbg>?

Option Explicit
Private Sub CheckBox1_Click()
    With Me.Range("B17:D17").Interior
        If Me.CheckBox1.Value = True Then
            .ColorIndex = 6
            .Pattern = xlSolid
        Else
            .ColorIndex = xlNone
        End If
    End With
End Sub

Todd wrote:
> 
> I have code written that when the control check box is
> selected certain cells will highligh.  I would like for
> those same cells to turn white when the check box is
> unchecked.  What code do I need?  Thanks!
> 
> Private Sub CheckBox1_Click()
> Range("B17:D17").Select
>     With Selection.Interior
>         .ColorIndex = 6
>         .Pattern = xlSolid
>         .Value = 0
> 
> 
>     End With
> End Sub

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
9/10/2004 6:15:22 PM
Ps.  I'm not sure what you were doing with the .value statement.

Todd wrote:
> 
> I have code written that when the control check box is
> selected certain cells will highligh.  I would like for
> those same cells to turn white when the check box is
> unchecked.  What code do I need?  Thanks!
> 
> Private Sub CheckBox1_Click()
> Range("B17:D17").Select
>     With Selection.Interior
>         .ColorIndex = 6
>         .Pattern = xlSolid
>         .Value = 0
> 
> 
>     End With
> End Sub

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
9/10/2004 6:15:43 PM
Reply:

Similar Artilces:

Pass Combo Box values to report
I have a form that passes criteria to a report. A combo box selects from a table with two fields code, description. Two questions 1. On selecting a code it would be nice to print the description for the code selected alongside the combo box in the form. 2. I can pass the code to the report, how can I pass on the description as well. Thanks CJ Create a query using your exising table and also the combo's RowSource table. This way you can add description field to the query grid. Then open your report in design view, and set its Record Source property to the name of the query. Since the...

Copy text from cell and paste it in a separate text box (contents to be linked)
Dear Experts: With some cells in a colum selected (say 10 selected cells in a column: contiguous range) I would like a macro to copy the contents of these cells and paste the contents of each cell in separate text field. Now here it comes. The pasted contents in the text field should be linked to the cell contents, i.e. whenever the cell's contents is changed, the contents of the text field should reflect this. Is this feasible? Help is much appreciated. Thank you very much in advance. Regards, Andreas Again, Detail and before/after examples. -- Don Guil...

cell referencing from a Combo Box
I'm trying to make the result given in a combo box make data appear i the cells (or text boxes) to the left and right of the combo box. Th data being drawn from is a range of cells in a column that is part of table with the same arrangement as the combo box/cell arrangement. just want to be able to choose data from that table, and by choosin one element in a row, have the rest of the row appear around it. I've been trying to find a formula that will allow a cell to refer t the result in the combo box, and give its result as the cell dat adjacent to that given in the combo box, as th...

Message box pop up when no reults
How do I create a message box pop up when my query returns no results? Thanks I tried this and received an error 3061. The code is in the On Got Focus of the combobox. The error is issued as soon as the form is opened. Could someone tell me why? TIA Ron "Klatuu" <Klatuu@discussions.microsoft.com> wrote in message news:E52A5872-7B1F-4D95-96C5-E00DFC4816F3@microsoft.com... > Dim rst As Recordset > > Set rst = CurrentDb.OpenRecordset("MyQueryName") > If rst.RecordCount = 0 Then > MsgBox "No Records Found" > End If ...

Check 2 columns of names for duplicates
I have 2 very large lists of names. I need to quickly see if any of the names that appear in one column match any of the names in the other column. (One list is existing customers, one list is leads for new business. I don't want to send existing customers an offer to do business.) Chip Pearson has a bunch of techniques for working with duplicates at: http://www.cpearson.com/excel/duplicat.htm jimp wrote: > > I have 2 very large lists of names. I need to quickly see if any of the names that appear in one column match any of the names in the other column. (One list is existing cust...

Is it possible to create a modalless dialog box in the worker thread.
hi guys, is it possible to create a modalless dialog box in the worker thread, actually we have try this but we got error that is" you cannot create object with new operator in the worker thread " but i don't know what is the actual reason behind this. actually i am trying to create a modalless dialog box from main dialog box and i want to perform openGL programing on both the dialog box in such a manner so that they do not collapse or crash each other because at one time only one rendering device context should reside in the memory if we want to create more then one device co...

spell check #27
I used to have Spel Check, but have lost it, I dont know how to go about getting it back, as I'm not very good with this computer. Can someone Please help me. I have an XP Thanks Bev You need Word, Excel or Powerpoint in the same version as Outlook to have Spell checker. If you don't have any of those, you can use a free addon. "New user" wrote: > I used to have Spel Check, but have lost it, I dont know how to go about > getting it back, as I'm not very good with this computer. Can someone Please > help me. > I have an XP > Thanks Bev "New...

Use batches for bank transaction entry checks and receipts.
Why don't you implement the batch feature in the Bank Transaction Entry window? The RM Cash Receipts window has all the batch features needed in the Bank Transaction Entry window. Many clients don't like the fact of losing control over the requried "post" feature in the Bank Transaction Entry window. The clients want to use a batch to enter, save, edit, print and then post, the checks or receipts. This would really add some practical value to every Great Plains customer. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggest...

VBA code #4
Does anyone know what is the code for adding a text message in an emai VBA spreadshee -- billy2will ----------------------------------------------------------------------- billy2willy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2164 View this thread: http://www.excelforum.com/showthread.php?threadid=39235 I am sure you will find it at www.rondebruin.nl/sendmail.htm -- HTH RP (remove nothere from the email address if mailing direct) "billy2willy" <billy2willy.1t5qee_1123020307.8914@excelforum-nospam.com> wrote in message news:billy2wil...

Tender Type Scan Code
Hi everyone, What does the field Scan Code do when creating or editing a tender type? Does it allow me to select a tender type with a barcode scanner? Thanks in advance Rance Edwards Scan codes are used with programmable keyboards (ie PREH keyboards)...here's the help guide summary on scan codes pasted below: Scan code: The keyboard macro code used to directly advance to the tender type during a point-of-sale transaction (only if the keyboard has macro definition capabilities). For example, assume you have a programmable keyboard and want to program a code for the Cash tender type...

Autofilter by Combo Box Selection
I am looking to autofilter a worksheet to show the items that do not equal the selection in a conbo box. Does anyone know the code to autofilter by 'does not equal' the combobox selection. Regards Rob M ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ The easiest way to see the code is to turn on the macro recorder (tools=>Macro=>Record a new macro) and perform the action manually. The turn it off and look at the code. I believe the criteria will use ...

IF command in Excel
Im not greatly familiar with Excel, could anyone point me in the direction of a tutorial on the following. Id like to set up a rule where 1) Excel reads what words I am inserting into a cell 2) If the word is a certain word, excel knows to put the figure in the adjoining cell into a certain locations Ie (Cell 1a) Burgers, (Cell 1b) 8 (Cell 2a) Fries, (Cell 2b) 3 Etc Etc Excel needs a long list saying if (cell 1a) says Fries, insert 8 into (say sheet 5 cell 47) If (cell 2a) says Fries, insert 8 into (say sheet 5 cell 47) If (cell 1a) says Burgers, insert 3 into (say sheet 5 cell 48) If (cell...

Read Receipt Button
How can I add a Read Receipt button to an Outlook 2003 toolbar? I can't seem to find it anywhere in the normal toolbar customization stuff. Iwould like to be able to click this button to get a receipt on selected emails I send out. Thanks. Jim Use the View->Options to select this for specific emails. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Jim asked: | How can I add a Read Receipt button to an Outlook 2003 t...

window mail code 800cccdf for gmail
I can not send emails using this program i have checked my settings they are correct this is A New Computer with 1gb of Memory and almost 1tb of harddrive space here is one of the messages i get XOAUTH authentication failed. None of the authentication methods supported by your IMAP Server (if any) Are Supported on this computer Your IMAP command could not be sent to the server, due to non-network errors. This could. for Example indicate a lack of memory on your system. Configurate Account: my account name Server: imap.gmal.com User Name.: My User Name Protocol IMAP Port...

Receive email to process commands
I'd like to connect two Sharepoint servers on separate networks by email. Let explain.. no, there's no time let me sum up. Sharepoint server 1 is on a LIVE, Production network. Sharepoint server 2 is on a test network where part of the test/development work will be done. The project begins on SP1 where status is displayed, emails sent as part of workflow, etc to customer via the production network. I'd like to add a workflow on SP2 that sends and email to SP1 (only way these two servers are able to communicate is via email proxy, beyond my control). SP1 would "...

Previous Command No Longer Works
I’m using coding below to insert “0000-yy” into a textbox. The numbering system works great except that I have lost the ability to move back to the previous record. It must be something to do with the code. How can I fix it? Private Sub Form_Current() If Me.NewRecord Then Dim strWhere As String Dim varResult As Variant strWhere = "IncidentID Like """ & Format(Date, "yy") & "*""" varResult = DMax("IncidentID", "tblIncidentLog", strWhere) If IsNull(varResult) Then ...

Combo box determine subform
I have a form with combo box WoDefId I have approxs 300-400 options to choose from for WoDefId in my combo box. I have a separate table(PMLink) setup with columns LinkNo (autonumber),WodefId(text),Linkform(text). What I am trying to do is select 1 of the 300 Options in my combo and use that value to open the subform. The LinkForm column will contain up to 50+ different subform names of which I only want the selected one to become visible on my main form. I am sitting here with a mental block on the easiest way to code this. Ideas? -- Message posted via AccessMonster.com http://www.accessmo...

How to stop check date from changing when downloading from bank
I recently switched to Money after using Quicken for about 15 years. I can't figure out how to stop the date in the register from changing, when I download my bank transactions, from the original date I entered when I wrote the checks to the date when the check clears. This is a problem, for example, with checks for charitable donations that I wrote and sent off in 07 but don't clear until 08. In Quicken, the date remained in the register the same even after downloading the cleared transactions. Thanks for your help. "Harry in NY" <HarryinNY@discussions.micr...

Problem with Excel-VBA
Hi, I have following problem. I've programmed an application for a customer in EXCEL-VBA with several text-file outputs. The source-code is as below: Public Sub StartSeiteErstellen() Dim fileNr mDateiName = Pfad_AktKatalog & "Katalog.htm" mstrHTML_Kopf1 = Range("HTML_StartSeite_Kopf").Value mstrHTML_Kopf1 = mstrHTML_Kopf1 & Range("HTML_StartSeite_Body").Value mstrHTML_Kopf1 = mstrHTML_Kopf1 & Range("HTML_StartSeite_Fu�").Value mstrHTML_Kopf1 = fVariablenErsetzen(mstrHTML_Kopf1) ' Datei-Ausgeben: fileNr = FreeFi...

XML commands
Hi. I found a very helpfull hint to find formula-cells. The trick is to use the get.cell function. I would like to learn a little bit more about that function. What does 48 or 6 mean in get.cell(48;.... or get.cell(6;... I can't find documentations at the net ? Regards Peter Get.Cell(num, cell reference) is a function from XL4 to return information about the formatting, location or contents of a cell. 48... if cells contain a formula it returns True; if a constant it returns False. 6 ... returns the cell formula Peter Noneley has a free download at... http://homepage.ntlworld.com/no...

Help with drop-down box creation
I have a large spreadsheet of case manager activity. Each case manager has a certain number of rows and columns for his/her information (case manager A uses the area A3:G43, case manager B uses H3:N43, etc.). There are 13 case manager areas in group 1 (rows 1-43), 13 in group 2 (rows 44-86), 13 in group 3 (rows 87-129), 4 sets in group 4 (rows 130-172), and 5 sets of totals at the bottom (rows 173-215). I want to create a drop-down box that would point to and locate the case managers' last names or worker ID#s. These items are not contiguous--they are located at cells B...

Minimise button on title bar and resize
I'm trying to create a dialog which cannot be resized and when the user double-clicks the title bar, it should NOT become full-screen size. Also, I'd like a minimise button only. I can't seem to get this right. What am I missing? Thanks in advance, Alain > I'm trying to create a dialog which cannot be resized and when the user > double-clicks the title bar, it should NOT become full-screen size. Also, > I'd like a minimise button only. > > I can't seem to get this right. What am I missing? What have you tried that doesn't wo...

Checking Parameter of POEMDEV and disable starting printjob
Hi all, my problem is, that a printjob may only start, if all must fields are filled, which are stored in POEMDEV. I tried to check the values in hrOEMDevMode if the dwMode=OEMDM_MERGE. If I do something like this: SetLastError(ERROR_INVALID_PARAMETER); hResult = E_FAIL; // The buttons print and settings are grayed // or // hResult = E_INVALIDARG // The buttons print and settings are grayed Is this the correct place to check the data and how may I set the error values to gray the print button or to disable start of printing? Thanks Kai Has no one any idea? ...

Outlook 2002 Send and Receive progress box
I am finding most times you send or receive email the Send and Receive progress box window appears and does not close automatically. even after checking the box that will close screen automatically. It is a very annoying problem. Does anyone else have same problem or is there a simple fix I don't know about. My email account is via Lan and is POP3 Thanks RC Take a look at this MS KB article, it may help: http://support.microsoft.com/support/kb/articles/q327/9/07.asp -- Russ Valentine [MVP-Outlook] "Rod" <anonymous@discussions.microsoft.com> wrote in message ne...

custom buttons on toolbar
i have added a couple extra custom buttons to my excel file. thes buttons are used to bring up my user form, but when i copy and past this excel file to another computer, the buttons do not showup, and have to manually go add these buttons again. There are going to b multiple people using this file, is there a way to copy the toolbar also. Thank -- tess45 ----------------------------------------------------------------------- tess457's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1393 View this thread: http://www.excelforum.com/showthread.php?threadid=2656...