handler

  1. H

    Creating Userform Controls At Runtime

    Good morning I am adding controls at runtime to a userform. I have done this before and I cannot work out what I am doing differently this time. I can add the controls alright and I can add the event handler code in the form module programatically. The form loads alright but the event...
  2. S

    Error Handler for acCmdPrint

    Hi guys, just wondering for a error handler so I can cancel the print dialog . Private Sub cmdRptStunden_Click() Dim stDocName As String stDocName = "rptObjektStunden" DoCmd.OpenReport stDocName, acPreview DoEvents DoCmd.RunCommand acCmdZoom100 '100% einstellen, falls...
  3. N

    Array or Loop how to question

    Hi guys, I'm still learning and I'm not familiar with using loops which I think would be the solution for this issue. So I have some code here that I wrote but I'm sure there is a much better way to input this using a loop or array: If Range("B9").Value = "" Then GoTo Handler Else...
  4. C

    VBA Excel I run a group of macros and need to have an error handler for one of the macros

    So I run a group of called macros and I have an error handler in the "update SOS" macro, what I want to figure out is how to do an error handler which will terminate the whole macro bundle if "No" is selected. I currently have a message box to inform the user the SOS is not being updated but...
  5. M

    VBA to Select Multiple Files when one is too long

    Trying to use the code below. If I select two files for example, and one of them is longer than 255 characters (including path), Excel will crash. It ignores my error handler and just crashes. I cannot figure out a way to get past this. Any ideas? Sub Macro1() Dim vSelectFiles As Variant...
  6. gheyman

    Best Event to use

    I have a date field. I want to put in code that fills it in when information in another field is changed/added. I know the code but was wondering what was the best even handler to use. Before Update, After Update, On Change.... Thanks
  7. Z

    Copy & Paste VBA code - Events

    I have a macro that pulls data from one worksheet, creates a new worksheet and adds a pivot table. I want to add an event handler to the pivot table of the new sheet. How do I add the event handler code with VBA rather than copying a text file and pasting it to the Pivot Sheet? Private Sub...
  8. I

    A VBA IF function that returns an msg with two different font in the same cell

    Hi there, I have written an if macro that toggles a hide/unhide range when the ranges header is clicked. However i would like to add a down arrow for when the range is hidden and an up arrow for when it is unhidden. my code so far is; Sub numbers() Range("8:21").Select If...
  9. P

    logging vba code errors?

    I've got some code that I've been having a minor issue with, so I wrote a bit of error handling code to take care of it. With part of my handler code I wanted it to write the error number and description into a cell on a sheet so that I can track when the error occurs and what error. I've...
  10. D

    Error Handler occasionally activates with no error

    I am having an issue with a bit of script where an error handler will be called when there is no error. This script is pulling data from SAP. The way I want it to work is when there is no data to be found, the error handler is called. While that is working, occasionally, the error handler...
  11. H

    Error Handler Is Only Exiting Sub

    Good day all, Hope you are well. I have written a Error Handler based on analystcave.com' info on proper techniques. The Error Handler is for multiple errors, Error 11 (division by zero) and other errors. Two different nmessages are displayed in the event of errors. The problem is even...
  12. H

    Error Handler: Nothing Happening

    Good day all, Hope you are well. I have written a Error Handler based on analystcave.com' info on proper techniques. The Error Handler is for multiple errors, Error 11 (division by zero) and other errors. Two different nmessages are displayed in the event of errors. The problem is even if I...
  13. S

    VBA error handler

    I am trying to add a simple error handler to a UserForm Basically something like this If Cell xxx ="#VALUE!".then UserFormXXXX.show Else do nothing End else Exit sub
  14. M

    Copy chart as picture on another worksheet INTERMITTENTLY fails

    I have a routine that, amongst other things, alters some cell values that in turn determine the content of a series of charts. Each time the charts are changed, the routine copies the chart and pastes it as a picture into another worksheet. I am 99% certain the code is sound but, for some...
  15. V

    VBA - Escape Key and Error Handler

    Hello, I am trying to get excel to go to my error handler if Esc is pressed whilst the macro is running. This is what I have so far but when I press Esc, Excel goes to the error handler and breaks on the first line with error 'User interrupt occurred' instead of running through the code in the...
  16. V

    VBA - Go To Error Handler if Macro Interrupted

    Hello, Is there a way to make excel Go To my Errorr Handler if Esc is pressed half way through a macro running? This is to make sure things like Events and Screen Updating are turned back on if a macro doesnt reach it's end and does it itself. Thanks
  17. N

    Internet Explorer event DocumentComplete does not fire

    Hello folks I am struggling to use events with IE automation from an Excel workbook, to feed some data from a web server into Excel. The queried page takes very long, and I would like the user to initiate the query with IE to obtain the data, then once the web page is complete, return control...
  18. S

    help on text file import error handler

    Dear all I am importing a text file into the excel I am working on errorhandler now there are only three possible runtime errors i can get 1st is user cancels the procedure 2nd is the destination sheet alerady exists 3rd is if text file is not found I am able to workout first 2 , i need help...

Some videos you may like

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top