![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: North Carolina
Posts: 35
|
I'm back again for more help. This site is great. Here's my problem: I have an Excel worksheet that includes both cells and check boxes where the user can input information. I want to automate the process when the user wants to clear the input sections. I've tied the following macro to a button:
Sub Clear1() Dim MyVar MyVar = MsgBox("Are you sure you want to clear this record?", vbYesNo) If MyVar = vbYes Then Range("A5:N19").Select Selection.ClearContents ActiveWindow.SmallScroll Down:=12 Range("M21:N23").Select Selection.ClearContents Range("H21:I23").Select Selection.ClearContents Range("C21:D23").Select Selection.ClearContents Sheets("Employee Guide").Select Range("C14:D14").Select Selection.ClearContents Range("C14").Select End If End Sub This works great to clear the cells. However, this does not clear the check boxes that are on the worksheet. I'm using the check boxes that are found on the "Forms" toolbar, not the ones found on the "Control Toolbox" toolbar. What do I need to add to my macro to accomplish this. Also, on a side note, is there any way to change the font color used with this type of check box? Thanks |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 363
|
Assuming the check box is linked to cell A1, to clear it do the following:
Range("a1") = False
__________________
It's never too late to learn something new. Ricky |
|
|
|
|
|
#3 |
|
New Member
Join Date: Apr 2002
Location: North Carolina
Posts: 35
|
Works Great!!! Thanks.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|