cancel

  1. C

    Message Box for Empty Cells within a range of multiple Cells

    Reaching out! I've used this VBA to give me a msg box if a cell within the range is blank Application.ScreenUpdating = False If IsEmpty(ThisWorkbook.Sheets(6).Range("U76", "U229")) Then MsgBox ("Please Review your answers, you've missed one") Cancel = True End If it...
  2. M

    [VBA] Handling events on added controls

    Hi there, I am struggling with events in forms. In brief I am passing information between listboxes on each multipage. Number of pages on multipage control depends on number of specific worksheets. So if user has 4 different tabs with different data, form will be initialized with 4 pages. On...
  3. D

    Unprotect Sht, Run VBA , Protect Sheet

    I am using the following VBA to copy a row complete with all the Formulas, but my users keep *accidentally* deleting the formulas so I want to protect Col B:K Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True...
  4. N

    Getting Msgbox Error displayed Twice when closing userform

    Hello i am getting Msgbox Error Twice when i close the userform Can someone check and help me to get rid of the MsgboxError when i close the userform Basically if the date is wrong for which I puroposely incorporated Cancel = True in the If EndIf so that textbox1 is set focussed but when i...
  5. L

    CheckBox & Text Box with Multiple Functions

    Below is the coding I have that currently functions almost flawlessly! :laugh::laugh: I need the Msg windows to send the user back to the form to finish entering the data required. As it is now the msg box will appear however when you click ok it just proceeds forward without even giving the...
  6. M

    Single Cells with Range on Workbook BeforeSave

    Hi everyone, I have a problem with a Macro that checks if certain cells contain data before the workbook can be saved. I copied the VBA code from the Microsoft online documentation about the Workbook.BeforeSave Event (Excel) and I cannot get it to work if working at Workbook level. The VBA...
  7. L

    Modify VBA Code To Do Nothing When Clicking Cancel

    The following code auto numbers a selected range that has merged cells. An input dialog pops that asks for to select/provide the range to auto number with the option to click "OK" or "Cancel", when I click "Cancel" it puts a "1" in a pre-selected cell. I would like to modify the code so that...
  8. T

    Before Double Click event

    The BeforeDoubleClick event syntax is as follows: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) End Sub I assume the Cancel argument is passed ByRef, so there's no need to write: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, ByRef...
  9. D

    vba delete rows and find &replace based on criteria

    hi. I would like to delete some rows based on the textbox value (as criteria) then to replace the next column with "cancel" please see below sample data Sample data below (in this example i will input "224" as criteria in my textbox) <tbody> A B C D 1 123 XXX 12 541 2 123 DDS 245 24 3...
  10. N

    Want script to not aply on ceartin rows and columns

    Hi there! This script changes the cell color when doubleclicked, but i don't want it to "work" for certain rows and columns because they are headers and other text. So...i want this script to be excluded from: row 1 2 3 4 5 12 21 And column: A I know you smart people knows how to fix this...
  11. T

    Format on Double Click Macro

    Hello All, My VBA is pretty weak, what I have is a conglomarate of on double click examples I found online that I have attempted to edit for my data set, and the addition of some code coppied from record macros to get formating values. Honestly, I am not sure if I am one letter off or 5 miles...
  12. sharky12345

    Prompt where to save - capture user pressing cancel

    I'm using this to prompt the user to save a a word document in their chosen location; With Application.Dialogs(wdDialogFileSaveAs).Name = "Welfare Document - RM " & TextRM.Value .Format = wdFormatXMLDocument .Show End With If they do go on to save I need the userform to be unloaded, but the...
  13. S

    Cancel button not canceling

    Hi all, Because I need to print on other printer than default, I use VBA code to show all available printers, then select needed printer & print: Sub Show_PrintersDialog_and_Print_Cards() Application.Dialogs(xlDialogPrinterSetup).Show Call Print_Cards End Sub The problem is this...
  14. S

    VBA insert tick

    Hi there, I have found the below code on the internet to do what I want, but when I want to expand the range it comes up with an error . Any one has any idea how to include H:H, J:J, L:L and N:N sections to it? Thanks
  15. C

    Excel 2013 VBA - Pauses on Open and Save Files - Cancel to continue

    Hi all Ive got a bit of a strange one. I have a macro which opens various files, and saves them. Occasionally on opening or saving, the macro seems to pause where the opening/downloading or saving dialog box appears (the one which shows progress on downloading/saving). The only way to get it to...
  16. W

    Adding text to macro via macro

    So I am using this code: Sub insert() ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule.AddFromString ("Private Sub Workbook_BeforeSave ()") ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule.AddFromString ("Cancel = True")...
  17. I

    Code to stop duplicate entries

    I have a userform where i enter data then when i press the Click To Transfer button this data is then entered on my worksheet. I would like a code so upon pressing Click To Transfer it should check first that the customers name does not exist. If the name does not exist then let the data be...
  18. I

    Disable Password Prompt

    Follow up from a (very) old post: https://www.mrexcel.com/forum/excel-questions/322118-disable-password-prompt-upon-opening-spreadsheet.html I wondered if someone could advise if its possible to de-activate the password prompt. I have a macro in place to link all the sheets to my master sheet...
  19. H

    Put Cell Value in Mgsbox and answer with a Value in cell

    I have in my worksheet Lots of Formulae's and the funkction ill need is this function. when i Click on cell G7 then a Mgsboks should Show up an then show result Value from Cell D6 on first line and Value for cell D7 on second line now the worst part of it all is Instead of "Yes , No ...
  20. R

    Not able to put column location from one worksheet to another

    When a user double-clicks on a cell in one worksheet (on row 10), I want to put the location of that column in F3 on another worksheet. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Cancel = True If Target.Column > 2 And Target.Row = 10 Then Dim c As...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top