Posts by Biznez

    Re: Save workbook after Save disable code


    Quote from cytop;744533

    In the Immediate Window (Ctrl-G) of the VBA dev environment type:

    Code
    Application.EnableEvents = False


    Save the workbook, then set EnableEvents = True again otherwise nothing will work.


    Thanks, worked like a charm!

    I have this disable save code but how can i save this code into the workbook?


    Code
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        MsgBox "Save is Disabled"
         '  Following line will prevent all saving
        Cancel = True
         '  Following line will prevent the Save As Dialog box from showing
        If SaveAsUI Then SaveAsUI = False
    End Sub

    This code is only deleting what the duplicate entry is, how can i make it to delete the row?



    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Column = 1 And Len(Target.Value) > 0 Then

    If Evaluate("Countif(A:A," & Target.Address & ")") > 1 Then
    MsgBox Target.Value & " is a duplicate entry. It will be removed.", vbExclamation, "Data Entry Editor"
    Range(Target.Address).ClearContents

    End If

    End If

    End Sub

    [h=2]Hello, i have inserted a listbox on sheet1. In column A multiple rows have data A, B, C. I would like to have the number of rows that have A, B and C listed in the Listbox



    so basically
    A=25
    B=2
    C=9



    thanks[/h]