error handling

  1. T

    Handling Errors from Match , stored in a variable.

    I have looked long for this, but i havent found a truly similar post on web in 2 hours. (so now im posting it on 3 forums) Scenario: dim Result as variant Result = Application.Match(string, Wb.Sheets("UD_Base").Range("UD_Base[U_ID]"), 0) --- Now if i check the values of -Result- it...
  2. D

    VBA - If file Path does not exist try another file path.

    Hi, I'm trying to write some code that will check if a file path exists = if yes continue macro, = if no try an alternative file path = if yes continue macro = if no exit with error msg. Basically my organisation has a strange network structure. For c90% of users the file path for the...
  3. C

    Error handling if worksheet does not exist

    Hi, I have built a macro that asks a user to input a development name into an input box. Then the code searches to see if there is a sheet with the name the user enters and deletes that worksheet. It then also removes a range of data on the summary sheet. The code I have so far is as...
  4. M

    Error handling that captures name and path details in a log without ending the macro

    I've developed a macro that crawls through a directory (every folder, sub-folder, sub-sub-folder etc), and deletes personal data from any Excel file that it finds - and this works well, so long as I ignore any errors along the way. What I would really like is for some form of error handling...
  5. P

    VBA - If error carry on

    Hi, I have the following code which moves files from one location to another.. If a file doesn't exist, I would the code to carry on to the next file rather give an error message "File does not exist" appreciate any guidance you can give. Sub everythingexcCRO() Kill...
  6. J

    Compare Slicer Text Values to List

    Hi All, I need a code to put at the beginning of a macro that will compare slicer values (they are text) to a list of text values in another worksheet (call it worksheet1). Basically, if the slicer value cannot be found in the list, I want the macro to kill the routine so I do not get a run...
  7. 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...
  8. P

    Error Handling

    Hello World I'm trying my hand at error handling & printing the same to a log file Issue: If there is any error while extracting the report path of any file, print the error & file name to a log file Here's the current macro I have to extract file details <code style="margin: 0px; padding...
  9. H

    VBA: Workbooks.Open Error handling within a For Next loop

    Hi, I'm fairly new to vba so any help is appreciated! I have a macro that loops through 5 cells B20-B24, opens the files specified in cells, copies the data and stacks them in the main workbook. What I would like to include is if one on of the files in B20-B24 doesn't exist, for the code to go...
  10. B

    On Error GoTo is causing data to be looped over twice

    Hello! This is my first time using an On Error GoTo solution within a macro and I cannot find any documentation online to help me with an issue I am running in to. I think it's an issue of where in the loop I have placed the error handling line. The snippet of code below performs a lookup and...
  11. B

    On Error Quit Macro - Otherwise keep going

    Hi - pretty simple what I am trying to do I have a feeling.....I have an input box in my macro and if the user clicks "Cancel" I want the macro to skip to the End Sub line otherwise execute all the code between the input box line and the End Sub line.
  12. T

    Basic Error Handling

    I have a macro that basically takes a data dump from QMOS into excel and makes it look decent and puts the information in printable order. I am looking to do some basic error handling that simply displays a message box if something goes wrong in the code. This doesn't need to be advanced at...
  13. P

    vba excel data validation - how to clear entry?

    I get the input and error title I want on invalid Excel dates, but clicking 'Ok' still leaves the invalid entry. Clicking 'Cancel' clears it. Is my syntax wrong? Can I refer to the cell in error and clearcontents on it? [CODE] Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim...
  14. bs0d

    Error Handling Query Errors

    I'm not real polished on error handling, and I'd like someone to sanity check my function. Here's what is intended: run 3 queries (insert, delete, insert) capture rows affected store error numbers and descriptions (if any) provide update status in update log table Public Function myUpdate()...
  15. E

    VBA - Error 9: subscript out range - Why does this error occur in my code?

    Hi all, I'm a total newbie in VBA, so while trying to do a bubble sort routine, I was constantly getting an error 9: Subscript out of range. After I added an optional rank in LBound() function, it worked, but I don't understand why. Could someone explain why does the second code work, while...
  16. G

    VBA - Error handling and adding data validation for dynamic drop-downs programmatically

    Hi all, I have what I think is a bit of a unique issue (at least I wasn't able to get any hits on Google). I have a file where I have to add data validation programmatically. This data validation is dynamic dependent drop-downs. These have to be based off named ranges - they can't be strictly...
  17. gallen

    Prevent User from Switching Sheets

    I have code in the Worksheet_Change event to select a cell after another one has been changed. I have very basic error handling code set up. A user has just filled in a cell, then without losing focus from the cell has changed to a different worksheet. An error is produced in the...
  18. K

    VBA- Nested For Each Loop to Scrape HTML Data Table- If Error move to next cell

    Hey Mr. Excel peeps! I have been working for quite a while on a way to scrape data from an HTML table. I have been coming along further and further, but am stuck again. Thanks to John_w, (Thanks John_w!), I have edited my code with the following code below. I was running across an error after...
  19. S

    ErrorHandling - RunTime Error 5 on Second Run

    I am attempting to write some error handling for the first time. I have written a bit which works correctly on the first go-through, but on the second run it generates a Run Time Error 5 Invalid Procedure Call or Argument. Sub PickFolder() tryagn: With...
  20. C

    New Sheet Macro Error Handling

    Hi All, I'm looking for some error handling options for a workbook I'm providing support for. It records orders on a daily basis by creating a new sheet for each day. I have a macro that I need in every new sheet that's created. I created a master sheet with a workbook code that will copy the...

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