cancel

  1. T

    Len() function

    Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strMissingInfo As String Dim strMsg As String If IsNull(Me.[Debarred]) Then Cancel = True strMissingInfo = strMissingInfo & "Debarred" End If If IsNull(Me.[Restricted]) Then Cancel = True...
  2. I

    Apply text to a cell userform to worksheet in current working code

    Good morning, The code in use is supplied below. Currently when i press my Postage Sheet Transfer Button the values are added to my worksheet and the cell in column G is applied the interior RGB colour Red. Please can you advise how i also have text in the same cell, so not only is it then...
  3. J

    VBA User Selected Range Error on Cancel

    I have been using this bit of code to get a user selected column (uses worksheet and string inputs). HOwever, if the user selects cancel, it errors out. Interestingly, it was working until I declared all my variable types. Any idea how to work around the error? Thanks, Justin Private...
  4. E

    "Saving" Notification/Status window not closing after VBA Save

    Though currently on Office 365 I have experienced this issue in earlier versions as well. I am using the ActiveWorkbook.SaveAs command to save a new workbook. The save is successful; however the Saving status window does not close. In order to continue processing I must select Cancel...
  5. L

    If cell is Empty!

    Hi all, I am trying to check for all sheets if specific call E10 is empty and it prevents user from saving. Currently it is only working on the sheet that i am on. It does not work on the others, i want to make it that it checks all check for a specific cell before saving. This is currently...
  6. H

    Value Odd in cell Vba Code....

    Hey i need some help with this code Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) On Error Resume Next If Not Intersect(Target, Range("F10:R19")) Is Nothing Then Target.Value = Target.Value + 1 Target.Value = Target.Value / 2...
  7. K

    Trying to reduce repeating code

    I have a userform with three textboxes that collect a search term: search1, search 2, search3. The search value runs through a function generating a list which populates listboxes: listbox1, listbox2, listbox3. If an item in the listbox is doubleclicked then it runs an Instr function selecting...
  8. M

    Ignore right mouse click on form control

    Hi gurus in the sky I use form control buttons to make life easy for my users. I want to disable a right click totally. I have discovered how to disable the "cut, copy, paste etc" menu by pasting into ThisWorkbook Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target...
  9. G

    Prevent "Backwards" Tab in Userform

    I have a userform with a bunch of text boxes, and on the bottom a Submit and Cancel Button. I want to be able to tab through these, but because the Cancel button is the last in the TabIndex, if a user is holding Shift and presses tab, it will go "backwards" to select the cancel button. Is there...
  10. albertc30

    TextBox format validation...

    Hi all. Firstly, as always, a much big thank you for all the help provided in the past and currently. This is much appreciated. Secondly, another issue. This issue being I have a textbox for customer phone. I need to format this to only allow 11 digits, no more, no less, it can't use...
  11. M

    VBA Code to clear contents Not formulas on spreadsheet

    Hi can anyone help please, I have the following code that clear the contents as well as the formulas on my spreadsheet. Can any tell me please how not to clear the formulas . Thanks Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 'Modified 6/18/2019 3:09 PM...
  12. J

    Remove conditions

    Okay, I am having a total brain fart and should be able to figure this out.. This is part of the code for one function in my massive dBase. As you see it's a Yes, No, Cancel call. I want it to default to NO all the time and go right to the IF statement, without it popping up the Yes, No...
  13. H

    Disable Save and Save As

    I want to disable both Save and Save As - I have VBA that saves the document specifically for the user and I don't want them to try and save it as their own file. I have this: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If SaveAsUI = True Then...
  14. M

    Help with existing code

    Hi can anyone please help I have the following VBA Code that works great but what I know would like to do is rather than the code copy the first 4 cells on a row when I double click, let’s say cells A1-A4, can the code not touch and leave cell A3 alone . So even if I was to modify the code...
  15. Jaafar Tribak

    'Auto_Close' missing 'Cancel' argument

    Hi, I looked at a question posted in the forum which intrigued me to wonder if there is some way to abort the closing down of a workbook within the excel AutoMacro Auto_Close . Something similar to setting the Cancel arg to True in the Workbook_BeforeClose event. Any thoughts ? Regards.
  16. R

    Custom 'cancel' on Auto_Close

    Hi there, I have a 'very customised' spreadsheet which I have replaced all alert boxes with customised userforms. I have a form called CloseAreYouSure which is triggered when Auto_Close kicks in. This just confirms whether or not the application is to close down with a 'yes' & 'no' button: Sub...
  17. C

    Vba MsgBox - Question for cancelling!

    Hi everyone Hope you can help. I am using a button to run the below code which prints specific data to a PDF, though first it checks to see if cell M21 is blank. If it is then it prompts the user to warn them if they want to proceed or cancel. If they proceed or if cell M21 is NOT blank then...
  18. G

    Doubleclick Yes, No and Blank - VBA

    Hello everyone, I found a Code for VBA to use double click in certain cell to activate Yes and No. However, I cannot to add to that code that it also show blank (or returns to the default result aka do not show anything). Can anyone help me please? P.s I am newbie. Code: Private Sub...
  19. S

    Copy a cell text without any line break

    Good day, I need a Private sub when double clicked on a cell it must do the same as putting the cell to edit mode F2 and highlighting/selecting all text and copying it to clipboard. Currently it copies the text but when pasting in another program it pastes with multiple line breaks and i have...
  20. L

    Cancel = true

    Hi I have a form which has 2 text boxes, one for userName and one for password and 2 buttons, one Enter and one Cancel. The article below is saying I need to make Cancel properties of a command button to True then I can use ESC key to cancel. I want to understand that better. So here is my...

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top