cancel

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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
  13. 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...
  14. 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")...
  15. 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...
  16. 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...
  17. 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 ...
  18. 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...
  19. S

    Dates Switching from Form to Cell

    I have a form with 2 date fields which have some formatting options in the VBA code. When I put in a date like 10/08/2018 in the form... when it puts the date in to the corresponding cell on submission, it's switching the date to 08/10/2018. I've formatted the cells to dd/mm/yyyy and the...
  20. I

    Check form before submit

    Evening, I have a working code that checks text boxes before the form is submitted. Also on the form are 3 CheckBoxes & 3 OptionButtons Below is the working code which works fine for the TextBoxes but now i need to allow for 3 CheckBox & 3 OptionButton Please can you advise. Private Sub...

Some videos you may like

This Week's Hot Topics

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
Top