Check box and Command button code #2

This code will change the named range of cells yellow when 
the check box is checked and the command button is pressed 
which is what I want it to do, but when you check the 
check box, it will take the user over to my second 
worksheet named form where the range of cells are.  I 
would like for it to wait to take them over after they 
press the command button because multiple check boxes will 
need to be checked.  Any help is greatly appreciated.

Option Explicit

Private Sub CommandButton1_Click()
Call CheckBox2_Click
End Sub

Private Sub CheckBox2_Click()
If Me.CheckBox2.Value = False Then Exit Sub
Sheets("Form").Activate
ActiveSheet.Range("Address").Select
    If Selection.Interior.Pattern = xlNone Then
    With Selection.Interior
        .ColorIndex = 6
        .Pattern = xlSolid
End With
Else
    With Selection.Interior
       .Pattern = xlNone
End With
End If
End Sub

0
anonymous (74722)
9/15/2004 9:01:51 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
552 Views

Similar Articles

[PageSpeed] 59

You have one guess at your first post (but not at the second post).

Todd wrote:
> 
> This code will change the named range of cells yellow when
> the check box is checked and the command button is pressed
> which is what I want it to do, but when you check the
> check box, it will take the user over to my second
> worksheet named form where the range of cells are.  I
> would like for it to wait to take them over after they
> press the command button because multiple check boxes will
> need to be checked.  Any help is greatly appreciated.
> 
> Option Explicit
> 
> Private Sub CommandButton1_Click()
> Call CheckBox2_Click
> End Sub
> 
> Private Sub CheckBox2_Click()
> If Me.CheckBox2.Value = False Then Exit Sub
> Sheets("Form").Activate
> ActiveSheet.Range("Address").Select
>     If Selection.Interior.Pattern = xlNone Then
>     With Selection.Interior
>         .ColorIndex = 6
>         .Pattern = xlSolid
> End With
> Else
>     With Selection.Interior
>        .Pattern = xlNone
> End With
> End If
> End Sub

-- 

Dave Peterson
ec35720@msn.com
0
ec35720 (10082)
9/15/2004 11:12:25 PM
Reply:

Similar Artilces:

Payables issue with Applied Payments and Void Check
Hi, We had a user a number of months ago apply a number of Credit Memos from a vendor to a large invoice while creating a check. Apparently the check was then void, without a normal check number leaving us with "REMIT0000000000xx" as the reference to it. We now have a situation where the large invoice and all of the credits are still showing in the system as open. The individual credit memos do not show as having amounts applied, but when we try to apply them we're told that the amount is already applied. Everything seems to be stuck in limbo, with no way to post to resol...

If Formula #2
How would I make an if formula to say if Column A = MF then add the numbers in column B so that it would be MF=18 and FW=8? A B MF 3 FW 4 MF 2 MF 6 MF 7 FW 4 One way: =SUMIF(A:A,"MF", B:B) In article <0a4601c37b9f$56f0bd20$a401280a@phx.gbl>, "Matt" <matthew_elliott75@yahoo.com> wrote: > How would I make an if formula to say if Column A = MF > then add the numbers in column B so that it would be MF=18 > and FW=8? > > A B > MF 3 > FW 4 > MF 2 > MF 6 > MF 7 > FW 4 ...

Code to Query SQL Server with a parameter value (entered into an Input Box), and have that value also display in a selected cell on a worksheet
I'm wondering how BEST to accomplish this. I have a EXCEL workbook which populates data to, and retrieves data from SQL Server. I currently have VBA code which effectively sends the data from the EXCEL worksheet to SQL Server tables -- no problem with this. I currently have VBA code which effectively retrieves data from SQL Server and displays that data back into the worksheet -- no problem with this either. I'm currently using a Command Button (on-click event) and the code below to query SQL Server to determine the Max Version Number and add 1 to that value. This value is t...

Disappearing messages on Office XP Outlook #2
Is the user using a hide read message view? ? nntp://msnews.microsoft.com/microsoft.public.outlook/ One of my customers has a strange problem. Click on the message in the inbox and it pops up into the full frame BUT poof it goes away from the inbox. The same holds true if you print the message. The only way to insure it's continued presence is to save it to another folder such as My Documents. Anybody got any ideas? Reposted to include my email. Thanks in advance. Darrell [microsoft.public.outlook] ...

Spell Check #20
My spell check does not work, any sugestions? thanks Nope, I do not have a spelling tab, thanks anyway. >-----Original Message----- >Hi Jerry, > >Example below based on Outlook 2003 > >Your Spelling options may not be turned on. Open Outlook go to tools>options>spelling tab>in the General options section>choose the options you feel you would like to use. If you have Microsoft Word installed (with Outlook open) go to tools>options>mail format tab>in the message format section here you can choose Word to edit your e- mail. > >Hope this helps! ...

Looking to invest or are you an inventor check this out !
Looking for all new product ideas to invest in or are you an inventor who would like to post your already patented or copyrighted products or resume online this is the msn group for you check it out ! http://groups.msn.com/InvestInInventions- ...

Parallel Box Plots
Hi, I was wondering if it was possible to create parallel box plots on Excel 2007.. What's a "parallel" box plot? Box and Whisker Charts in Excel: http://peltiertech.com/Excel/Charts/BoxWhisker.html - Jon ------- Jon Peltier Peltier Technical Services, Inc. http://peltiertech.com/ On 5/27/2010 5:36 PM, Kristina wrote: > Hi, > I was wondering if it was possible to create parallel box plots on Excel > 2007.. ...

Sending emails with attachments #2
I would like to know when sending files by email, if there is a way to have the file open when the email is opened rather than have the file arrive as an attachment.. "Richard Mahan" <dmachen35@comcast.net> wrote in message news:Gc2dnWGZpeyIn07YnZ2dnUVZ_qGjnZ2d@comcast.com... >I would like to know when sending files by email, if there is a way to have >the file open when the email is opened rather than have the file arrive as >an attachment.. You and every spammer in the world would love this option. -- John Blessing http://www.LbeHelpdesk.com - Help Desk ...

Enlarging the 'check box'
Without changing the zoom value of Excel, how does one increase the size of the checkbox in Excel 2002/OfficeXP? -- HansM What I have here, is two screenshots of checkboxes, enlarged to 33x33. One is checked, the other isn't. On the UserForm, I put two PictureBoxes on top of eachother and each of them gets it's own picture. If checked is clicked, then unchecked will be visible, and backwards. A sample form is here: http://www.geocities.com/smplprgrsrc/files/checkboxes.zip The 2 little .jpg's are also in there. "HansM" <sayno2@spam.com> schreef in beri...

List control #2
Hi All, I am creating a list control using CListCtrl class(MFC). Can anyone let me know how can i gray/disable a single item in a List Control so that the user will not be able to select it?. Thanks & Regards, Senthil U�ytkownik "Senthil" <Senthil@discussions.microsoft.com> napisa� w wiadomo�ci news:6E4B49A2-4C4B-4074-B441-2E78E39F2B0F@microsoft.com... > Hi All, > I am creating a list control using CListCtrl class(MFC). Can anyone > let me know how can i > gray/disable a single item in a List Control so that the user will not > be able to selec...

Message box at file open
For a particular Excel file, I want a message box to open as soon as the file is opened. Do I need to use VBA for that? If yes, I'm new to VBA. Any quick pointers? Thanks all. Hall, > Do I need to use VBA for that? Yes, you do. From the workbook, press Alt + F11 Double click on "THisWorkbook" in the "Projects" window. In the panel on the right, copy and paste the following: Private Sub Workbook_Open() MsgBox "My message" End Sub John "Hall" <hall@garp.org> wrote in message news:eAp0TW53DHA.3360@tk2msftngp13.phx.gbl... > For a ...

Need SQL command
Hi If I'm running a number of the following SQL update commands Update customer set LastClosingBalance=? where accountnumber='?' Update customer set LastClosingBalance=? where accountnumber='?' It is only running one at a time, what is the command I use in between to make sure that they all run at once? -- Jenny It is running them all but only reporting the results of the most recent query. Your results of '1 record affected' are simply from the last query. All of the previous queries did run - use a SELECT query to verify if you don't trust me. Tom ...

Excel Beta 2 2003
Are the files produced by the 2003 Excel readable by earlier versions of Excel? If so, is there any special way that they have to be saved??? The file format used by Excel 2003 is the same as earlier versions, so earlier versions (97, 2000, and 2002) can read and use files created by Excel 2003 with out any problem. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com chip@cpearson.com "dsears" <dsc36@cornell.edu> wrote in message news:09aa01c36586$91a30970$a101280a@phx.gbl... > Are the files produced by the 2003 E...

Cell Formatting Problem #2
Perhaps I'm missing something, but when I format a cell to have the text control to be "wrap text" the text does not appear to be wrapping. However, if I then go back to that cell and choose to format the row height to autofit, I get the text to wrap. Can someone tell me if I'm doing something wrong here, or is this normal? Hi is this a merged cell? -- Regards Frank Kabel Frankfurt, Germany "scottcts" <scottcts@discussions.microsoft.com> schrieb im Newsbeitrag news:C9E1934D-7749-4843-A6D3-A0C1547AB4E4@microsoft.com... > Perhaps I'm missing some...

putting 2 charts on 1 sheet.
In Excel 2003, it is possible to copy a chart from 1 worksheet and paste on a worksheet that already has a chart? It doesn't seem to want to work right for me. One pastes over the other one. I'm thinking because the sheets that the charts are on originally were created for each chart. I was able to add a worksheet and copy/paste each one onto it just fine so I have what I needed. Was I just trying to do something that couldn't be done the way I was trying? Thanks for any input. Use worksheets instead of chart sheets. -- Don Guillett SalesAid Software dguillett1@au...

Convert 2 per page post card to a 4 per page post card
I have created a post card using a template, but when I look at the print preview it shows 2 post cards per page, the paper I am going to print them on is 4 per page. How do I conver the document or change the layout? What version Publisher are you using? If you are using 2007 use one of the Avery US Letter postcard templates, copy/paste your created postcard to the new page setup. Make a note of the color scheme, you may have to re-set it after the paste. If you are using an earlier version, you should be able to go to page setup and change the copies per sheet. "HptRdsRealtor&q...

F9 Button Macro
Is it possible to make a button which acts as an alternative for pressing F9 to create new random variables? If yes, how do I go about it? F9 recalculates. You could add a button from the Forms toolbar to a worksheet. Assign it this macro: Option explicit sub myRecalc() application.calculate end sub Andrew McLeod wrote: > > Is it possible to make a button which acts as an alternative for pressing F9 > to create new random variables? > > If yes, how do I go about it? -- Dave Peterson Toolsw>Customize>Commands>Tools There are two buttons available. Calc...

Code 38 When Inserting USB FD
About 50% of the time when I insert a USB FD, the system make a noise (the clunky sound when a USB device is inserted) but then doesn't recognize the drive. If I pursue troubleshooting I get the "an instance of the device driver is already in memory" (Code 38). I am using WinXP Prof SP3. I ALWAYS remove a USB FD by using the eject process. And the problem can occur with any of several FDs or my external DVD burner. Further pursuit leads to "reboot your system". Even the KB for this http://support.microsoft.com/kb/310123 suggests the same fix. I don&#...

Making a combo box enable for two case
i Have a combo box name Cbmonth when click a specific case i.e. month sales the box enables, Me.cbMonth.Enabled = (SalesPeriod = byMonth) what i need is when we i select Sales person case i need the cbmonth to enable i've tried this me.cbmonth.enabled= (SalesPeriod = byMonth and BySalesPerson) but it doesn't work Any ideas anyone ??? Write it like this: me.cbmonth.enabled= (Me.SalesPeriod = "byMonth" Or Me.SalesPeriod = "BySalesPerson") Note: I am assuming that SalesPeriod is a bound control on your form and that it has text data...

Creating a formula to a cell containing a date #2
Thanks, Works perfectly. This forum rocks!! -- hb247 ----------------------------------------------------------------------- hb2474's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=418 View this thread: http://www.excelforum.com/showthread.php?threadid=26433 ...

SQL Table conflicts? 1.2-3.0 upgrade failure?
Hi, I am trying to track down why I cannot upgrade from 1.2 to 3.0. Since I know little about SQL could someone please help me understand why there are about a dozen conflicts in both MSCRM and METABASE tables? The conflicts look something like conflict_CRMMetaPub_COMPANY__METABASE_Attribute (about a dozen more) There are a similar entries in the MSCRM table. I have tried going offline/online with all the clients to see if that clears the conflicts. What I find curious is that all the dates are creation dates of July, 2005 when some customizations were done. I get an "Action Mi...

Message Box Formating
Is there a procedure that can be used to change the font and background colors for message boxes? -- Enjoy the blessings of the day. jerry Jerry, No, you can't change the font or colors of a message box. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Gerald Evans" <gerald.j.evans@worldnet.att.net> wrote in message news:vkaod.950527$Gx4.387440@bgtnsc04-news.ops.worldnet.att.net... > Is there a procedure that can be used to change the font and > background > colors for message boxes? > > -- >...

Kruskal Code
Hi All I'm looking for an example of Kruskal's algorithm in VBA. I need to find the minimum lengths of cable required to network a number of pc's / buildings (say upto 20) So, based on a sort of 'mileage' calculator grid where it shows the 'distances' between towns - I'd like to do the same thing for pc's. Only I'd like some code that then calculates the shortest possible routes for joining them all up without creating a 'cycle' or circle. Any help would be much appreciated. I have searched the web but have found only C,C+ & Java type e...

How to extract/filter unique records from 2 lists?
I have 2 lists, say List A with 300 entries and List B with 320 entries. List A's entries are all in List B and I want to know what are the 20 different entries in List B. Short of manually eyeballing both lists, how do I extract or filter out those 20 unique records? ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Enter this formula in C1 to see if the value in B1 is there in the list A1:A300 =IF(ISERROR(MATCH(B1,$A$1:$A$300,0)),"Not There","There&...

I get a "MS LAPD Directory" dialogue box asking for a password. #2
What do I do? My end goal is to send fliers in the body of an email - not an attachment, and I was told my Outlook is not set up yet, though I can get my hotmail emails. ...