vba error handling

  1. N

    How to use error handling properly inside a for loop

    I am trying to hgilight all the cells in a specific column in which a match isn't found. I came up with some code that works perfectly as is, but the problem is that it exits the execution after encountering the first error, and I would like to continue the execution until the for loop ends and...
  2. R

    error handling for files that are already open

    Good Morning :) I have a macro (Excel 365) that opens a file on sheet1 in column A Row 1 copies data then opens a file in column B row 1 pastes the data then saves the file then moves down to row 2 and does the same then to row 3 etc....etc.. (Thanks Joe4) What I can't figure out is the...
  3. A

    Best Practices for Error Handling

    Hello. I have the code below that first checks to see if a certain field (header) exists before changing the formatting. Should I perform the same error checking for the fields at the bottom? Is there a better way to handle errors? Private Sub FormatColumns(ByVal tbl As ListObject, ByVal budDt...
  4. R

    VBA Autofilter Error Handling

    Hi everyone, I have a part of my code where I delete some rows based on information found with autofilters. On the first filter, when it does not meet the conditions, the code just skips it as it should. On the second filter, the error handling is not working. blankcolumn = Cells(1...
  5. most

    Handling errors from a WinHttpReq function

    Hi, I would like some assistance with handling errors from this function. SomeDownload1 will return WinHttpReq.Status = 404, what is the best practice of returning a error code back to sub routine? SomeDownload2 will run-time error at line 6 (WinHttpReq.send), how to handle this? I searched...
  6. J

    Handling errors in VBA calculations

    Hello I would like some advice. On one of my sub I have over 25 different calculations in VBA that get used to create a value. I am having problems where if one of the calculations is divided by zero then I get an error message. At the moment I am using the on error resume next. But this does...
  7. J

    Need some advice on error handling

    Hi.. I have created a complete the project with few userforms as my stock inventory. And the project running without any error. I need ur advice wether i did the codings in the right way or not. And need some advice for error handling. Below are the coding and pictures of my userform and...
  8. J

    Adding a msgbox if error occurs after input box

    I am having trouble adding in code to display a msgbox when a user inputs a variable text value into my inputbox that cannot be found. My code is looking for a outlook folder matching what the user entered into the inputbox (this value is variable) and if it doesn't find it, the vba will error...
  9. X

    HELP: VBA Run-time error '-2147417848 (80010108)'

    Hello, I am trying to run simple macro but I get this error: VBA Run-time error '-2147417848 (80010108)': Method 'Range' of object '_Worksheet' failed My procedure is following: Sub Fill_Empty_Cells_with_Formulas() Application.ScreenUpdating = False Dim rng As Range Dim i As Long...
  10. A

    Searching values on sheet and matching with Combobox coloum

    Hi Guys, I am trying to get this code to work, and just keep hitting my head against the wall not being able to get it to work. Below is the code i have at the moment. It loops over the cells on the sheet, the loops over the combobox list entries, when match is found copies to the sheet...
  11. P

    subscript out of range

    Hi, The following code seems to work to fine, however at the end it says "subscript out of range" - please could you help? Much appreciated. Sub exportsheets() Dim wbNew As Workbook Dim rngTM As Range Dim strPath As String On Error GoTo Errorcatch Application.ScreenUpdating =...
  12. P

    Type mismatch... VBA

    Hi When I run the following code I get the 'Type Mismatch' error: The code works ok for the first export (in terms of saving in location), however will not work thereafter. Sub exportsheets() Dim wbNew As Workbook Dim rngTM As Range Dim strPath As String...
  13. W

    How to Handle Errors in VBA: resume the loop with the next value

    Dear all, I am using a readily available piece of code that is supposed to use Google in order to search for a list of entries, returning the first result from each search. Here is the code itself: Sub XMLHTTP() Dim url As String, lastRow As Long Dim XMLHTTP As Object, html As...
  14. M

    VBA Help

    I have a code in excel to run through columns of names / emails / cc's / subjects / one body text and create an email in my drafts folder with the corresponding details. This uses the .to = , .cc = , etc. Our email server no longer recognizes the emails that get put into that field. Our IT...
  15. S

    help with run-time error '91'

    I receive the run-time error after my very last end sub. The code runs everything I want it just shows that error at the end. The final end sub uses the bb code to make it blue. Sorry for the long code. I'm running Windows 7 and Word 2010. Public thisQuarter As String Public thisYear As...
  16. J

    error 438

    Dear all, In the Macro code given below, Public Sub sortet() Dim a As Integer Range("U6:U12").Select Selection.Copy Range("U13").Select Selection.Paste <label for="rb_iconid_4"></label> End Sub in the above sub-procedure the selection.paste showing error no 438 with a message "object...
  17. J

    Need Design Help - VBA newb in trouble.

    Hey Guys, Im working on a VBA app and playing around with Error Handling, and this is what my call for help revolves around. Im trying to determine the best way (and possible ways) to implement error handling. I've learned VBA is pretty limited in ErrHand (I've been doing some C# as well, so...

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