exit

  1. A

    Exit Function inside With-End With block

    Is this acceptable practice ?
  2. G

    Select Previous Cell

    Hello, Have the following code which works except it highlights the entire area it posted the data after doing the macro instead of just staying where the cell originally was. How can I get it to stay on cell B2 after running this code? Private Sub Worksheet_SelectionChange(ByVal Target As...
  3. I

    Could you check my code please

    In my worksheet i have a code where when i type a number in a cell in column A its matched photo of which i have named the same as the entered number is automatically placed into the same row but in column B So A50 i type 123456 when i leave that cell automatically the photo 123456 is now shown...
  4. P

    How to insert a character while the user is still typing

    Is there a way to insert a character while the user is still typing. For example if the user is entering the date, automatically insert either a "-" or "," or "/", or a "." after the first two characters. For this instance I just need to insert the character after the two digit month followed by...
  5. MFish

    How to find duplicates in two separate cells

    I have a code to check for a duplicate in column B7 and downward. I need to somehow configure it so it finds a duplicate in row B7-downward AND C7-downward. Here's the kicker... I need it to be like an "AND" function. It will be OK if the unique ID's are duplicated in column B as long as the...
  6. MFish

    Limit users to combobox list

    I have the property set to, "Match Required" for my comboboxes. I have a clear button that resets all of the values of my comboboxes to nothing, "". It keeps saying the selection is invalid after the clear button is pressed. I'll then fill out the form with the correct information and I'll...
  7. G

    Active Cell to Run Macro

    Hello! In columns B2:B20 I have the Names of all the other sheets in the workbook and each sheet has information in it. What I want to be able to do is click on, let's say B4 and it references the appropriate Sheet name and pulls that data range to L2 and continue that process for each B:B...
  8. D

    make them push a button on exit

    HI ALL i this code to save my sheet as a pdf using info from cell c2 Private Sub CommandButton1_Click() ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ filename:="C:\release" & Range("C2") & ".pdf", _ OpenAfterPublish:=False, _ IncludeDocProperties:=True, _...
  9. M

    Macro to find and replace values in several columns of a table

    Hi, I have the following macro which replaces the data in cells that are not blank within several columns in an Excel table, however the macro takes more than two hours to run due to the size of the table (40,000 rows and 50 columns). Is there a more efficient code I could use that would...
  10. D

    force a command button to be pushed before exit

    how do i force a command button to be pushed before exit.
  11. V

    Frustrating Excel VBA problem (Newbie with decades of experience, but apparently not enough)

    This is excel 2019 being extended with vba. Trying some simple, nonsense first.... and then.... FRUSTRATION the following code snippet is used as follows Cell #f21 has a value of tograms(a21,b21,16) A21 is typed as a numeric and has a value of 16 B21 is typed as text and has a value of “oz” 16...
  12. H

    Input date if Date + 30 days < current month and year

    I have the following code below I would like the input box to appears to input the date only if the date in A3 on sheet BR1 +30 < date , otherwise exit sub It would be appreciated if someone could amend my code Sub Date_Input() Sheets("Sales").Select Dim MyDate As String...
  13. S

    Userform Closing Excel

    Hello, I have a userform that has decided that it is going to close excel each time I use it. I'm not sure where I've gone wrong in my coding and was hoping someone could double check it for me. thanks! Private Sub CommandButton5_Click()'"next" page button On Error GoTo Helper...
  14. T

    How to make user input .Value entered as specified British date format and not auto-ing to American

    For example I enter 01/05/19 The 1st of April 2019 in my userbox Exit the macro 05/01/19 is entered in the cell instead. Sheets("View").Range("B3").Value = Me.Specifictext.Value I can only assume this is a Microsoft feature that reverts the value to American.
  15. W

    Help with Run-time Error '91' with code

    I have a userform that I am trying to get working. I have the inputs all set, make the validation, set it if correct but can't seem to get past the 'copy the data to the data base'. Here is my code: Private Sub CommandButton_Add_Click() '----------------------------------------------------...
  16. S

    Error Checking

    So I've written this error coding. I was hoping someone could check it over and tell me 1. why userform18 won't show when running and 2. Is there coding I can put in userform 18 that would allow me to "screenshot" a highlighted string of code (the code that error'd) and screenshot (or save as a...
  17. S

    Error Handler

    Have I written the following piece of code out correctly for handling errors? The XXX for error code is my own reference sheet of "error codes" so I can see which of the 187 modules (talk about a mess...) has an error and the other error code should come from excel. I want this to allow the...
  18. MCTampa

    VBA Exit Do Then Run Something Else

    I have a line of code which works. Do... If .....then Exit Do When the code is satisfied the loop stops, but I want it to move on to a next step and I am not sure how to do this.
  19. I

    Simple amendment needed in code

    Hi The below code was kindly provided to me some time ago.Sub GlobalCommentsCell() If ActiveSheet.Name <> "Training Log" Then Exit Sub 'If Selection.Value <> "" Then Exit Sub If Selection.Column <> 9 Then Ans = MsgBox("This routine will only work in Column I!" & vbNewLine & _ "Would...
  20. Z

    MsgBox modification to include clicking the "X"

    I have a simple Yes/No message box that will exit the sub if the user clicks "no". I saw on another forum where someone mentioned that we can "add another condition to test the user's response for something else in addition to vbYes (perhaps to test for no response by clicking the X to close...

Some videos you may like

This Week's Hot Topics

Top