fails

  1. E

    Why is TRIM function failing in VBA?

    We have a macro for users to run. One user has Excel 2007. Would this version be the reason the following code fails on the "TRIM" function? I works in 2010 and later. theAnswer = UCase(Trim(Cells(ques, 2).Text)) or theCaption = UCase(Trim(UserForm1.Choice1.Caption)) ' This is reading a...
  2. kelly mort

    Trying to use "PageSetup.PaperSize" with a constant not working

    So I read stuffs and learned that I can use a message box to find the constant assigned to the current paper size then used that and pass it to the "<code style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit...
  3. J

    Insert rows fails

    Hello: I've counted rows in file1 and want to insert 2.25 rows in file2. Everything is fine until row insert statement. I get the error: Insert method of range class failed. I've tried a ton of other iterations and can't get it to work. Any help would be greatly appreciated! Dim wb as...
  4. P

    Last Month

    Any good way to get Last Month as a month number using today's date? Previously I've done =NOW()-32 and that seems to work, but without figuring it out you could run into a day in a month where this fails? Like the first day of the month would take you back 2 months until you hit the 2nd or 3rd...
  5. M

    Custom views

    Workbook has no tables and no protected sheets. Have created several custom views but excel does not successfully switch between them e.g. view “males only” works. Switch view to show people from e.g. certain town - also works but switch back to “males” only view and it fails - includes “females...
  6. O

    VBA - Copy Several Ranges to last empty cell to the left

    Hello awesome ppl Hey I have an issue with my vba code that WORKS only on the 1st 5 rows, but fails when I go to low This works Sub Part_2() Worksheets("Raw Data").Select Range("AL3:AL7").Select Selection.Copy Range("D3:AJ3" & Columns.Count).End(xlToRight).Select ActiveCell.Offset(0...
  7. M

    Refreshing ListObject

    I've run into a curious problem. Using Data-New Query - From Oracle Database, I've created an ODBC connection to oracle (with a SQL statement). What I'd like to do is use VBA to force a refresh. My current method is using SSIS to execute a "Macro"/subroutine which works until it gets an...
  8. S

    Download error checker

    I have a macro that runs/calls 10 other macros that download pdfs from specified URLs online. these aren't big files... like 5-8mb BUT these are coming via a VERY SLOW satellite link... so if I download 10 pdfs via 11 macros (1 macro that calls each of the 10), is there a way/a macro/piece of...
  9. G

    Weird Error 400 problem

    I have some code which works for me, but gives an Error 400 message to another remote user. MsgBox 1 ActiveSheet.Unprotect Password:="abc" MsgBox 2 Range("ShiftMonths").Copy 2 is the last message the user receives before the code fails. "ShiftMonths" is a range on the active...
  10. A

    VBA Script fails when triggered by Worksheet_Activate()

    Hi All, Quite embarrassed with this one but can't for the life of me fix it. I have a VBA script that works perfectly when triggered as a Macro, but fails when triggered by Worksheet_Activate. The line that fails is: dest.Range("A6:M1000").AutoFilter Field:=pn.Column, Criteria1:="" Where...
  11. R

    Take second Vlookup if First one fails?

    Hi, Can anyone advise how to achieve a result for the following if the first vlookup fails: First Lookup: =VLOOKUP(C22,'RATES'!A13:DN686,35,FALSE) Second Lookup: =VLOOKU(D22,'RATES'!A13:DN686,35,FALSE) Thanks
  12. J

    VBA if Save Fails then saveas

    Hi, I have thisworkbook.save in some of my macros though if save fails I would like to saveas in the same folder.... Same file name but include V2, V3 etc.... What is the best way to do this?
  13. S

    Vlookup fails to run - just leaves the equation in the cell ???

    I am using a Vlookup equation that works perfect in 3 cells (it is looking up a date associated with a name. it is looking up a date in column 5, 6 and 7. but when i try to use THE EXACT SAME VLOOKUP EQUATION to bring back something else, it just fails. it just shows the equation, equals sign...
  14. P

    VBA Error when retrieveing data from SAP: Error message "The virtual key is not enabled"

    I am using a for-next loop in Excel VBA to search and retrieve information from a list. If the search returns anything, the VBA macro works fine- it displays, copies, and pastes the returned information in my Excel Workbook. If it returns nothing, it fails when trying to copy the query results...
  15. B

    SELECT multiple specific pages

    I want my user to pick which pages to select. Once they're picked, I can put them into an array, but the SELECT fails. SELECT(ARRAY("Sheet2","Sheet4")) works, but if I build it first, like aSheets = ARRAY("Sheet2","Sheet4") SELECT(aSheets()) it fails on an error 9, subscript out of range. Any...
  16. M

    VBA lookup/Transpose function

    I have been using the following code for some time now, and of all the code that I use this has always been problematic. I often get a type 13 mismatch error and my macro fails to run properly. Dim rngFound As Range: Set rngFound = Columns("A").Find(WSO.Range("L2").Value) If rngFound...
  17. M

    VBA UserInterfaceOnly Refresh Pivot Table

    THere have been several discussions on this but I cannot find a solution. I used the following code on workbook_open Worksheets("Inventory").Protect UserInterfaceOnly:=True, AllowUsingPivotTables:=True I would expect it to allow code to run on that sheet including refreshing Pivot tables, but...
  18. G

    'Selection' Compile Error

    Hi All, having a problem with Excel 2016, code that had always worked has stopped working! When it is run I get an error. "Compile error: Expected Function or variable" and highlighted is "Selection" in the code. I am trying to write new code to do other jobs and anything with "Selection."...
  19. P

    VBA Query fails if Attachment field is present

    My query fails with "Invalid Operation run-time error -2147467259 (80004005)". It only fails when an Attachment field is in the table. The query runs correctly when I remove the Attachment field so I'm sure its mere presence is the cause. Is anyone aware of this? My first though is to create a...
  20. M

    A Second Lookup If The First Fails

    Hey everyone, My spreadsheet is getting rather large and slowing down some what, mainly due to several VLOOKUP's running which i know takes a lot of processing power, what i am trying to achieve using INDEX/MATCH is this =IFERROR(VLOOKUP(L:L,dItemLookUp,2,FALSE),VLOOKUP(L:L,dNPDItems,2,FALSE))...

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