Ask User To Confirm Delete Action
Jun 18, 2014
I'm trying to prompt user when he tries to delete a value from a cell so he can confirm is action but not the same way to all cells.
Let's say that I have cells A1:F10 with values, and user should be able to change this values but not to delete them (can't be a blank cell) and I want to prompt him that info (something like "Cell can't be blank!").
In other range a want a different thing: let's say cells H1:K20. In this cells user should be able to change cells values and also delete them but I want to ask him for a confirmation (something like "are you sure").
View 7 Replies
ADVERTISEMENT
Feb 11, 2009
1. I can't remember it, but I know there is a command so that the view hold and that the selected tabs and cells does not show and the same view remains until the "unhold" is called in the macro. THEN the view is updated. What is this command again? Could not find it...
2. The macro needs to delete tabs at the click of a button (easy part) but for each deletion, a message appear:
Data may exist in the sheet selected for deletion. To permanently delete this data, press Delete. Is there a way to prevent the message from popping out when the macro is executed?
View 2 Replies
View Related
Jul 26, 2014
I'm using macros to apply some complex sorting criteria. It is also applying some cell formatting specific to the sort criteria being applied.
At the start of each macro, I'm resetting all cell formatting to remove any formerly applied formatting that is not correct for the new sort criteria. Basic stuff.... works fine.
Now I need to ensure all formatting created by any macro-generated sort gets removed if a user applies a sort using any sort function from the Ribbon. (Reset all formatting prior to any 'manually applied' sort).
I can create the macro to reset the formatting, just not sure how to trigger it upon user action.
Is it possible to trigger a short macro to reset cell formatting when a user applies a sort using the Data>Sort, Data>Sort Ascending, or Data>Sort Descending commands from the Ribbon?
View 9 Replies
View Related
Sep 27, 2012
I am about to write a small macro to do a iteration calculation. I would like though for the user to select me a cell so that the macro uses the value in that cell to start calculations. Now, what I think would be the problem is how do I code a "time" or notice an action such as clicking in a cell to continue with the macro.
Would it be by inserting a pause in the code of a certain time so that gives the user time to click and wait for the code to start? If so, how would much time is enough? Is there another thing that could restart the code such as "noticing a click in a cell" command in VBA?
View 1 Replies
View Related
Mar 25, 2013
So I have this worksheet full of formulas that I do not want users to accidentally delete. Now, I know I can use the standard "Protect Sheet" option to not trigger any accidental changes but I would like an additional safety check (since management users will have access to unlock the sheet) via a macro to prompt the user with a message box (with Yes / No options) which essentially asks the user if they are sure they want to delete a cell if the "Delete" button is chosen? If the answer is No, nothing will happen. But if the answer is Yes, it will delete the contents in the cell.
View 1 Replies
View Related
Jul 29, 2014
I need the tabs of a project action log to auto-populate and auto-delete in a master log. (So when something is added or deleted in a tab it is added or deleted on the master) I use excel a little bit for work and personal finance purposes but I have zero experience with macros or VBA.
View 1 Replies
View Related
Jun 4, 2012
How I can confirm whether a particular value exists in a range. i.e.
ABCD11Yes/No22
Does the Number 4 exist in the range
A1:A8?334455667788
View 3 Replies
View Related
Aug 19, 2013
I have to do a project, but I'm not really sure how to go about it. Here's my problem: I have about 200 stock ticker symbols already given(ie. AAPL, MSFT, NEE, etc...), and i have to create an excel file where i would copy/paste or enter in another set of stock ticker symbols and would give me back the answer if any of the newly entered symbols match the ones i already have(either in form of 1 or 0, YES or NO etc...).
View 4 Replies
View Related
Jan 5, 2014
Whenever updating an Excel file and saving it as a new file, a "Confirm Save As" window appears. The default is "NO" (No is Highlighted). Conversely, in MS Word, the default is "Yes" (and, YES is highlighted). I would like to change the default from NO to YES in Excel.
View 1 Replies
View Related
May 11, 2009
pop up form within userform to confirm choice. I have a button within a userform that clears the form:
View 5 Replies
View Related
Oct 18, 2005
i have a macro button designed to wipe all user entered data into a workbook. I want it so you cant accidently press (as you cannot undo the operation). Anyway for making a dialog box appear asking if you are sure to wipe date, with a yes or not option.. no will obviously abort the macro.
if possible, another box to come up asking if you want to save the file first with a different file name (comes up with a save as box).
this is the code so far:
Sub MonthCleaner()
'
' MonthCleaner Macro
' Macro recorded 17/10/2005
'
Application.ScreenUpdating = False
Range("A10:G10").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("H10").Select .........
View 9 Replies
View Related
Nov 20, 2006
I have a button. When pressed, it runs a macro. Instead, after pressing the button, I would like the user to confirm to run the macro and display some info about it. This is to make sure the user does not accidentally run the wrong macro (button). I just need a prompt box, with a line info, and the two choices YES and NO. If NO is selected, nothing happens. If YES is selected, macro continues.
View 6 Replies
View Related
Oct 5, 2007
I have an excel form where users can input modifications by selecting a range and then pressing a command button to input a value in the selection.
My goal is: to restrict the location where a user can select a range of cell and then execute the macro . The cells where the user can use the macro are merged and in my code, I used the address as show in the address bar in excel for their location. If the user select a cell that is not permitted, a message box is displays and exits the code.
If (Selection.Address <> Range("AE7").Address) _
Or (Selection.Address <> Range("BM7").Address) Then
Msgbox ("Wrong location") Else
For some reason it doesn't work since the message box appears even if I am within the permitted locations.
Note: AE7 is the first cell of a merge, same as with BM7
View 9 Replies
View Related
Nov 9, 2009
I'm trying to use the following formula to verify if the "," is within a cell. Something is not right, because even for True conditions, I'm getting a False return. I think my True logical test is not written right.
View 3 Replies
View Related
Oct 13, 2007
I'm using Excel 2002 on and XP machine. I am creating a spreadsheet to track a work plan.
Column A: Name
Column B: Date
Column C: Time
Column D: YES
Column E: No
Column F: New Date
Column G: New Time
What I'm looking to do is input click able buttons in Columns D: Yes and Column E: No.
When a user clicks on YES, a pop up window should appear with the data in columns A,B,C.
The p0p-up should contain CONFIRM and CANCEL buttons.
Asking the user if they want to confirm the date and Time.
If CONFIRM is clicked Excel should then send an email to me and the user to say that the work schedule has been confirmed.
If CANCEL is clicked the pop-up window closes.
Secondly if the user clicks NO, a pop-up window should open with two free text boxes. One for Proposed date and One for Proposed time. And again 2 buttons for Confirm and Cancel.
If Confirm is clicked then Excel should record the data entered in the free text boxes into Column G and Column H and send emails to me and the user with the Proposed date and Time Data.
If CANCEL is clicked the pop-up window closes.
View 9 Replies
View Related
Jul 18, 2007
I've written some VBA which creates worksheets to temporarily store data in. At the end of the code I delete the worksheets. However, for some reason I am getting a message box which asks for confirmation. How can I avoid the user of my report having to click OK for each of the worksheets which need to be deleted?
View 3 Replies
View Related
May 21, 2008
I am trying to do a macro that looks to see if the date is different from one cell to another going down in rows. I got it to work until the cell is empty then it says the date dont match but I just want it to stop the loop. so it should go down a list check to see if the date is the same all the way down the list, stopping if cell is blank, if not give a message box, if it is the same stop.
Is As follows
Dim rowNum As Integer, colNum As Integer, currCell As Range
rowNum = ActiveCell.Row
colNum = ActiveCell.Column
rowNum = rowNum + 1
'get first cell
Set currCell = ActiveSheet.Cells(2, 3)
'loop while cell not empty
Do Until currCell.Value = " "
If currCell.Value = ActiveSheet.Cells(2, 3) Then
If currCell.Value = "" Then
End If
View 4 Replies
View Related
Mar 6, 2009
1) Allow user input of a number between 1 and 999
2) Search column three and delete any rows that don't match this number.
I have some code that would delete any rows within a certain column, based on predefined criteria and i've tried modifying it to suit my needs.
View 7 Replies
View Related
Jun 16, 2006
I am trying to figure out how to delete a row on a worksheet via a VBA User Form. I currently have a User Form with a Combo Box that is populated by cells in a named range ("PickCategory...") on a worksheet... I am populating thsi box using this
Private Sub UserForm_Activate()
ComboBox1.List = Worksheets("data").Range("PickCategory...").Value
End Sub
First off, I want to include a lable that will display the contents of the cell to the right of the currently selected entry of the combobox on a label (or textbox). So, whatever entry you select in the combo box, the corredponding value (to the right of it on the worksheet) will appear in the text/label
box. Is there something similar to the VLOOKUP that will work in VBA?
Also, what I want to be able to do is to allow the user to select one of the entries from the combo box (which is already working) and then be able to delete the row of that entry on the worksheet. So, the user selects an entry from the combo box and then clicks a "Delete" command button to delete the row of that entry on the worksheet...
View 6 Replies
View Related
Mar 6, 2007
i want to lock the excel sheet..so user cant add any data or delete it...only through VBA form????
View 9 Replies
View Related
Aug 20, 2007
I need a macro to sort through a large table of data entries and remove all repetitive entries (entires are based on a number in column A with data entries in B through EY) so i need to locate repetive numbers select entire row and paste them in a new location.
But i cant sort the data as it will change the entire order and i need the data intact.
the user will specify which entry number to search for.
I know some sort of search and loop function would work but i just cant seem to make them work.
View 9 Replies
View Related
Jan 18, 2014
I have a macro which works well. All it does is save a file to a specified location on my network. However, after a file is saved there is no prompt telling the user that the file was saved successfully leaving them wondering whether the macro actually worked.
VB:
Public Sub SaveAs() ThisFile = Range("X2").Value
ActiveWorkbook.SaveAs Filename:="legdcAudits" & ThisFile & ".xlsm", FileFormat:=52
End Sub
View 1 Replies
View Related
Jul 13, 2012
I am trying to have an operation run when opening the Workbook. The UserForm opens fine, but I get an error when the GoButton_Click sub runs. The error file is not very comprehensive.
The user is promoted to 'Delete' or 'Cancel' before the sheet is deleted. I do want to select 'Delete' for the user, but I'm not sure how to do this.
The error mentioned occurs after the user selects 'Delete'. The error is:
Run-time error '-2147417848 (80010108)':
Automation error
The object envoked has disconnected from its clients.
VB:
Option Explicit
Private Sub UserForm_Initialize()
Me.Choices.List = Array("Choice 1", "Choice 2")
End Sub
Private Sub GoButton_Click()
If Templates = "Choice 1" Then
[Code]....
View 5 Replies
View Related
Aug 21, 2008
I am using the following piece of code to delete unwanted rows from a worksheet:
Sub DeleteDates()
FinalRow = Cells(65536, 3).End(xlUp).Row
For i = FinalRow To 1 Step -1
If Cells(i, 3).Value Like "*2007*"
Cells(i, 1).EntireRow.Delete
End If
Next i
End Sub
What I am working with is a sheet of about 5000 customer appointments going back to the beginning of 2006. A have peiced together a lot of code to format it exactly as I want and to create a pivot table of what is remaining after the rubbish has been deleted.
However I am finding that I need to keep amending and re-running this bit of code, depending on the date range I want to look at. For example the code above will delete all appointments made in 2007.
My question is: is there a way that I could incorporate an input box, whereby excel asks the user for a start date and an end date and deletes any rows outwith that range?
Some important info: All of the dates are in column C, in the format mmm yyyy
I would only need to narrow down to a month - so for example mar 2008 - jun 2008
View 9 Replies
View Related
Sep 16, 2009
Hoping someone would be able to help me with this. I have a sheet (example attached) and this sheet has a number of varying description types in the W coloumn (usually approx 10,000 rows). This field is manually input so there could be spelling mistakes and/or non standard descriptions.
What I would like, if possible, is a macro that would look at the D column and if this is 'GENERAL LEDGER', it would then look at the W column.
An input box would come up, and would list the different descriptions it found in column W, and number them. It would only list each different description once.
e.g.
1. Bank charges
2. Bank charge
3. Cash
4. Fund Custodian Fees
5. Fund Manager fee
6. Interest income cash account
7. Interest income cash acc
8. Miscellaneous expenses
9. Miscellaneous income
10. Other income
11. Sec lending comm
12. Sec lending commission income
13. Tax Reclaimable - Dividends
14. Withholding tax dividend
The user would then be able to type in the corresponding numbers, if possible seperated by a space, comma or semicolon and the macro would then run through the sheet and delete the entire row if D was GENERAL LEDGER and W was the selected description.
View 9 Replies
View Related
Nov 7, 2012
I would like to delete a column using data validation list. for example :
i have a data validation INPUT list in cell A1 (Part No., Supplier 1, Supplier 2, Supplier 3) the heading start from B2,C2,D2,E2,F2. If user select Supplier 1 from data validation list in cell A1, the column Supplier 1 [c2] should be deleted.
And/or also if in cell B1 have a data validation INPUT row list (Part no.) & if user select part no.,
the selected part no. row should be deleted.
View 1 Replies
View Related
Nov 15, 2012
If possible, I'd like to be able to catch & handle the event of a User deleting a row (or potentially a column) from a specific Worksheet so I can then implement some automated "housekeeping processing" on other existing rows / columns.
I'm using XL 2010 so from what I've found so far it looks like I should possibly be using the Worksheet_Change() function, but beyond that I'm currently stuck.
View 1 Replies
View Related
May 25, 2013
I have a spreadsheet that I use throughout the day and have to send an email to another person when a customer makes a payment. The number of products they pay for will be different each time and I have the code to copy the right cells into an email and the code to insert the right number of rows for how many things the customer is paying for however as I use it multiple times through the day, I need the code to insert the right number of rows, copy it over to the email then automatically delete the rows it has just inserted so it is back to basics so I can use it again.
The code I have for the inserting the rows (from searching through forums) is:
Sub PRows()
Dim NextRow As Long
Dim NrOfCopies As Long
Dim i As Long
Const NrOfCopiesDefault = 1
Const NrOfCopiesMaximum = 9
[code]....
View 1 Replies
View Related
Feb 26, 2008
I would like to setup a macro that brings up a dialog box asking for a date in a specific column. Once that date is entered in the dialog box, the macro would then find all rows before that date (in that specfic column) and delete them.
View 9 Replies
View Related
Oct 7, 2012
I have a financial dataset which I need to "clean" before manipulating/analysing.
Each row of the data represents a completed transaction and the first step is to delete rows that are done with particular (internal) clients; the client data (the client's name) is in Column D.
Currently, I delete the unwanted data by autofilter and delete (code below), however this means the clients to be deleted are only defined within the code. I would prefer to have a worksheet within the workbook where the user defines the clients by adding or subtracting their name from a list.
I have created a dynamic range for the client list by inserting a Named variable along the lines of "=OFFSET(!$B$3,1,0,COUNTA($B$3:$B$200)-1," which works fine.
However how do I work this list into my code so that it works when new clients are added or deleted?
Current code for deleting unwanted client data:
Sub filterdelete()
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows.Count
With Range(Range("D1"), Range("D" & LastRow))
[Code] .....
View 2 Replies
View Related