Create A Clear/reset Button?
Sep 3, 2009
I'm just finishing a project that is a collection of three calculators, each of which returns data based on a series of user-supplied variables. All the mechanics are working [thanks in part to replies to previous posts], but there is one more thing I'd like to add:
Does anyone have a way to clear the contents of another cell [actually several] cells via another cell? As the most complex calculator requires eight variables to be entered, I'd like to provide a quick way [a button?] to "clear" or "reset" the calculator - basically wipe all unlocked cells. I should note that all of the cells in question already have Data Validation of one type or another.
View 10 Replies
ADVERTISEMENT
Nov 19, 2009
I have 4 combo boxes with selectable options and several cells for inputting data into. I'm looking to create a reset button that returns combo box values back to the first one in the list and clears all cells at the same time. I've figured out the cell reset as follows;
View 3 Replies
View Related
Jul 2, 2014
I have attached a test workbook excel 2010 (ignore ref# errors, I've cut the workbook down for uploading purposes) What I would like to do is have a 'Button' on my 'information Sheet' which when clicked would clear certain cells. I have searched the forum but can't find a solution, everyone seems to want to delete rows or columns but I just want to clear certain cells. The workbook will have 11 sheets each named 'caravan 1' through to 'caravan 11' The uploaded test workbook only only has 3 sheets.
On 'caravan 1' (which is slightly different to the other 10) I want to clear the content of cells
B4 & B5
C4, C22 & C41
D4 & D5
E4,E5, E22,E23,E41 &E 42
On all other 'Caravan sheets' I want to clear the contents of cells
D4 & D5
E4, E5, E22, E23, E41 & E42
It would be icing on the cake if it could give a warning such as " are you sure you want to clear these cells" but that isn't really necessary. The worksheets will be password protected, but the cells mentioned above will not be. If it proves too difficult to clear all the cells on all the sheets with one click, then perhaps a simpler solution might be to have a button on each sheet instead
View 8 Replies
View Related
Jun 19, 2007
How come I keep having the same value for "lastrow". eg: 35
lastrow = ActiveSheet.UsedRange.Rows.Count
It doesn't matter how many rows of data I've changed, it still show lastrow = 35.
I tried to add an extra line above but still doesn't work:
lastrow = 0
lastrow = ActiveSheet.UsedRange.Rows.Count
View 9 Replies
View Related
Jan 11, 2008
I have a userform with several combo boxes on it. I also have three command buttons, 'OK', 'Reset' and 'Cancel'. I want to code the 'Reset' command button to reset the values of the combo boxes to empty or "". I have attempted to do this simply by using the following code.
Private Sub cmdReset_Click()
cmbWaterTemp.Value = ""
cmbTypeFastIce.Value = ""
cmbIceDrift.Value = ""
cmbTrendBehavior.Value = ""
End Sub
When I click on the 'Reset' command button I get the following error.
"Run-time error '94':
Invalid use of Null"
When I use the debug tool the error pointed to is a different sub.
Private Sub cmbWaterTemp_Change()
txtTemp1Encoded.Text = Left(cmbWaterTemp.value, 1)
txtTemp2Encoded.Text = Right(cmbWaterTemp.Value, 1)
End Sub
I am not exactly sure why the error points to this sub. I know there must be a simple way to accomplish this. I am including a workbook that is similar though not exactly the same due to file constraints. What I want to happen is when the 'Reset' button is clicked is to clear all values for the combo boxes and the text boxes. I have successfully gotten the textbox values to clear although not the combo boxes.
View 4 Replies
View Related
Jul 18, 2013
I am working on some code that I would like the user to be able to re-run should the underlying data in the adjacent tabs change. My existing code is shown below
Code:
Option Explicit
Dim wb As Workbook
Dim ws As Worksheet
[Code]....
I'd like to be able to remove all data on the ALL tab so that when the UsedRange.Rows.Count is run again on that page it will only see the header row. In the past I've deleted or cleared data from the sheet and the Rows.Count still counts the rows which have no content in them.
View 2 Replies
View Related
Feb 24, 2009
A coworker has come to me asking for a way to indicate on a sheet whether or not any autofilters are applied, and a button to reset all the filters. The second part is easy, and I've got a CommandButton with the following code to do it:
View 6 Replies
View Related
Jul 3, 2009
I've included the code I'm using to calculate the net weight depending on which option button is selected. I use a flag ("VLAG") to know whether it's the first time the button is pressed. All variables are DIMmed at initialization (different sub).
By using other flags, I can see the code runs perfectly, but the tare weight ("TARRA") is not incremented each time the button is pressed. The formula I'm using to increment is
View 4 Replies
View Related
Dec 17, 2009
I want to add a secondary function to these buttons; this is a necessary function for every order, so I want to make it necessary to click one of the buttons for every order. One way to do this would be to leave the button unchecked.
How could the button be set to leave itself unchecked after being clicked on?
View 7 Replies
View Related
Jul 1, 2008
I have a Lookup that updates name from a list.
D2 =IF(LOOKUP($A$2,B:B,C:C)=",",LOOKUP($A$2,B:B,C:C)) - this Works fine
Say A2=3
C1= Name1
C2= Name2
C3= Name3
Also a macros that if D2 is typed over you can re-insert the LookUp.
Sub Reset()
For Each ce In Range("D12) 'Company
'If IsEmpty(ce) Then
ce.FormulaR1C1 = "=IF(LOOKUP(R2C1,C[-2],C[-1])=",",LOOKUP(R2C1,C[-2],C[-1]))"
ce.Font.ColorIndex = 11
'End If
Next
End Sub
The Weird thing is that in stead of putting the value from the LookUp it paste the formula
=IF(LOOKUP(R2C1,C[-2],C[-1])=",",LOOKUP(R2C1,C[-2],C[-1])) like it was text
I have used the reset on a number of numeric equations no problem, but not on a LookUp one. I've tried changing the format of the cell, but not successfully.
View 9 Replies
View Related
May 18, 2006
I have a spreadsheet with 4 combo boxes and 2 cells that I need reset to a specific value when a button is clicked (the top value for the combo boxes, the function [today()] for one cell, and a specific date for the other). I figured I would put the function and the specific date in seperate hidden cells and the button would link to them, but whatever way gets the job done will work. I know I'll need to code this in VB, but as well as I know excel i've never played with basic before.
View 3 Replies
View Related
Jan 24, 2007
I can't find a way to reset/clear the textbox in order to enter new data
View 2 Replies
View Related
Aug 22, 2008
I have a pivot table with over 4000 entries and about 12 columns which i filter to get the info i want.
Unfortunately with so many rows and columns in the table, if i do a macro that gets each filter back to 'show all' its really slow.
Doing this manually using the "Show all" option in the filter takes a fraction of a second, so surely there must be a way to do this more quickly in VBA?
i can't understand why manually it takes no time at all, but automating it through recording a macro takes forever.
View 9 Replies
View Related
Feb 27, 2013
I'm having a problem creating a Reset All command button that will remove user entered unlocked cell values from an entire workbook save for one specific worksheet. So for example, I have five tabs labeled as "DTF", "Week 1", "Week 2", "Week 3" and "Week 4". I want one single command button (placed in the "DTF" worksheet) to remove all of the unlocked cell values from "Week 1" to "Week 4".
View 9 Replies
View Related
May 8, 2014
I have never written or used a macro before and I have a simple macro task to complete:
I have Column L (L4:L10) of seven scroll bars that move according to number changes in column F (F4:F10). I want to create a form control command button that resets the changes on the scroll bars according to static column of numbers in Column E (E4:E10).
I don't know if it matters, but I'll add that I plan to add a second button that does the same thing with a different column of data. I assume I'll simply replicate whatever procedure I use in the first button - is this okay?
View 1 Replies
View Related
Sep 25, 2008
I want to create a command button that will clear whatever is written in a text box. I guess for this to work it needs to select all, then clear. The command button and the text box have been created using the control toolbox.
View 2 Replies
View Related
Jan 26, 2007
In ThisWorkbook Userform2 is triggered upon a double click
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
UserForm2.Show
End Sub
Userform2 has Frame1 (Option Buttons 1-6) and Frame2 (Option Buttons 7-12)
Private Sub OptionButton1_Click()
Call ProjectBuildings
Range("A1").Select
End Sub
Private Sub OptionButton10_Click()
Call BondIndustrial
Range("A1").Select
End Sub
The user can click away and things work great. The macros that are triggered search a number of Workbooks and individual Worksheets looking to select either of two (hence the two Frames) specific items.
If the user clicks any Option Button in Frame 1 (works) then any Option Button in Frame 2 (works) then goes back to the same Option Button in Frame 1 (nothing) I have a problem.
How do I clear the first Option Button in Frame 1 after the user selects another Option Button in Frame 2?
View 4 Replies
View Related
Apr 10, 2007
I have a CLEAR FORM command button
What codes can I use so that when I click CLEAR FORM, all the data that I encoded in the textboxes of my current userform will be erased as if I have a fresh new form?
View 4 Replies
View Related
Mar 9, 2013
i want to create a save button in sheet 1, on clicking the same the data entered in the particluar cells of sheet 1 should get saved in sheet 2 in given format
View 1 Replies
View Related
Jan 26, 2009
My Workbook with a macro to clear ONLY the highlighted Cells.
The Highlighted Cells can be found on the sheet "Line 5"
View 11 Replies
View Related
Oct 16, 2009
I'm putting together a time sheet that can used to calculate total hours worked by department etc. I plan on protecting the worksheet and only allowing certain cells to be selected and data entered.
Is there a way using VBA to place a button on the first spreadsheet that will clear all cells that are 'unlocked'?
View 6 Replies
View Related
Dec 11, 2012
I have created a command button, right clicked the button and selected 'View Code'. In the code window I've entered the following code:
Private Sub CommandButton1_Click()
IB_FB_Hedge_3 Outcome.range(W10:X11).ClearContents
End Sub
As soon as I enter the code a message pops up:
"Compile error:
Expected: list separator or )"
Is my syntax wrong? Is the sheet name, 'IB_FB_Hedge_3 Outcome' not allowed?
When I created this code a few minutes before I was not having the 'Compile error' problem, but the Command Button was not working either. When I clicked the command button it would just show the circles at the corners, suggesting that it is still in editing mode and not properly activated as a command button.
View 6 Replies
View Related
May 8, 2013
How do You Make a Button to Clear Certain Cells?I don't know how to make a button that clears a1-a5 and b1-b5. How do you do this?
View 5 Replies
View Related
Sep 3, 2008
I keep encountering an error while creating multiple sheets within the same workbook. This is a known error by Microsoft as documented here. In order to avoid using multiple workbooks i need to clear excels cache each time I run the macro as i have limited users sheet creation to 30 sheets which should not trigger the error. Does any one know a code to clear excels cache or memory?
I have used cutcopymode = false but that does not do the trick.
View 9 Replies
View Related
Nov 7, 2008
I have a button on my userform that I would like to clear all entries in column B in a sheet called "6 Entries" when pressed
Is there a code for this ?
View 9 Replies
View Related
Aug 10, 2009
I have seen this before in spreadsheets so I atleast know it is possible.
I have a worksheet that has 6 sheets in it. The final sheet is a formula page that only shows results if sheets 2-5 have data. Sheet 1 holds all the master data. Sheets 2-5 show subsets based on sheet 1. I manually atm filter sheet 1 for certain info and then copy paste into 2-5.
Seeing as I do this weekly. How would I go about adding in a 7th tab or even a macro that will delete all data from row3-end in tabs 2-5, then copy the appropriate data from tab 1 based on a set criteria?
I could write this in a macro just wondering if there is an easy built in way?
View 9 Replies
View Related
Dec 4, 2007
Function FindNth(Table As Range, Val1 As Variant,Val1Occrnce As Integer, _
Val2 As Variant,Val2Col As Integer, ResultCol As Integer)
Dim i As Integer
Dim iCount As Integer
Dim rCol As Range
For i = 1 To Table.Rows.Count
If Table.Cells(i, 1) = Val1 And _
Table.Cells(i, Val2Col) = Val2 Then
iCount = iCount + 1
End If
If iCount = Val1Occrnce Then
FindNth = Table.Cells(i, ResultCol)
Exit For
End If
Next i
End Function
To use this function, push Alt+F11 and go to Insert>Module. Paste in the code, push Alt+Q and save. Use the function as shown in graphic example. You can access it under "User Defined" in the Paste Function (Shift+F3).
Type Amount Sex Cost Purchased
Cat 1 Male $ 5.00 22/05/01
Cat 2 Male $ 5.00 15/00/00
Dog 3 Male $ 20.00 25/04/00
Rat 5 Female $ 1.00 15/08/01..................
View 6 Replies
View Related
Jan 14, 2009
So I've got Sheet 1 with say
____A___B___C
1___m___i___c
2___r___o___s
3___o___f___t
I would like to create a button that can create a new sheet and paste A1 to C3 at the same location on the new sheet
and I need this to create a new sheet and do that everytime the button is pressed.....
View 11 Replies
View Related
Jun 26, 2006
I am trying to create a command button in Microsoft Excel (Office 2000) that enables me to reset the check box status for a worksheet from checked to unchecked. The worksheet contains approximately 50 check boxes and is meant to be reused. Is this possible? If so, how can I program it to do so?
View 2 Replies
View Related
Nov 3, 2013
I have a spreadsheet containing 100 "requests" which can be made by a user
i would like the option for the user to be able to delete a request should they wish it either by deleting a row or clearing the contents
Currently I have a single column which is full of buttons (one for each row)
when i click the button on row 10 I would like row 10 deleted
when i click the button on row 30 i would like row 30 to be deleted etc
is there a way to do this without writing 100 macros which are specific to each line?
View 4 Replies
View Related