error

  1. S

    Syntax errors

    Good Morning, Trying to compile a workbook, I keep getting a few errors. Here are the first two: Syntax Error: Function TotalAdder(RCell As Range) 'Begins Error Handling Code On Error GoTo Helper Dim xIndex As Long Application.Volatile xIndex = RCell.Worksheet.Index nsheet = Left(Tname...
  2. S

    Workbook Closing closes other open workbooks

    I have the code below in a workbook. When I close the workbook, it typically kills all other open workbooks of excel. However, excel has started opening a blank window (no loaded workbook) in a second window whenever opening any excel file. Anybody have ideas on both of these. Further, sometimes...
  3. B

    Power Query - Combine, transform and track data

    Hello All, As a reasonably seasoned excel user, im embarking on learning power query to try to achieve something which could quite well be impossible :) So hoping I can get some clarification from the real experts! Situation: I have a CSV file provided to me every day detailing a list of...
  4. W

    Runtime Error 13 in my code

    I am getting a run time error 13 in my code between the **. Can anyone out there see why? For some reason the code will run and do what I want, but then spit out the error. Any help will be appreciated. Sub Recon() Dim i As Integer finalrow =...
  5. K

    range error

    I'm new to VBA so be gentle. This just started happening today. Whenever I select a preexisting command button to a macro, I get an error window listing the range as "Wrong number of arguments or invalid property assignment" What can I do now? Sub clearswitchboard()...
  6. G

    On Error GOTO Quit

    On Error GoTo Quit: Quit: MsgBox ("Please Add Data to Template Sheet" _ & vbNewLine & "Then Run Program") Hello All, I have the above code. The On Error GoTo Quit is at the top of the code, with the Quit: at the bottom. The problem is my message box keeps popping up, even when no errors...
  7. R

    If Statement on date

    I currently have data in cell AS2396 "04/11/2019 10:49:09", this then gets formatted to in BM column to read "04/11/2019" using formula "=TEXT(AS2396,"dd/mm/yyyy") and the world is great. However, if no data is in column "AS" and say its in column "C", how can I add an if error to to select "C"...
  8. G

    Excel-Word Interop, Add Watermark Issue

    I have a workbook that will convert multiple word documents at once into PDF format. I am combining two macros I found on the web to try and get them to open a word doc, place a watermark on the doc, and then export it as a PDF. It will do this once for each file in a folder that I specify in...
  9. T

    Not seeing the syntax error

    I have the following formula that is giving me a #VALUE ! error and I've been looking at it so long I can't see where the syntax is wrong. Can someone please help? =IF(AND(Y17="Replacement2",Z8<3),"Wave "&'Project Data Sheet'!J73&" Print Order","Wave "&'Project Data Sheet'!B101&" Print...
  10. K

    'Next without for' compile error

    Hello - I have the following macro and it is hanging up with a "next without for" compile error. I don't see what is wrong with it? Could someone please help me? It is hanging up on the line 'Next mycell". Public Sub ProjNumbrReq() 'Call ProjNumbrReq Dim myCell As Range With...
  11. R

    Runtime Error 1004 - Using VLOOKUP in VBA (COMPLETED)

    Running a very basic test code to try out on a large amount of data, but having trouble, getting the "1004" error. Sub HugeSort() Dim c As Integer 'LOOPS THROUGH ALL ROWS For c = 2 To 10 If IsEmpty(ActiveSheet.Cells(c, 1)) = False Then ActiveSheet.Cells(c, 2) =...
  12. T

    Run Time Error 1004: Cannot save this workbook with same name as another open workbook or add-in.

    Hello - Anyone able to assist a newbie on VBA coding, please. I have learned some great stuff reading comments and watching online videos, etc. But, I have patched together some code from various excel experts to: 1. save the file and then email as an excel attachment (.xlsx) The issue...
  13. D

    Inserting table column name into excel formula

    I got a question answered and then I posted another question in the same thread. I forgot I needed to post new questions in new threads. I get an error with trying to insert the following formula into a cell in vba. .Range("M11").Formula = "=IF([@[Wait Time/Hrs]]<3,3,[@[Wait Time/Hrs]])" The...
  14. D

    How to include double quotation marks in a formula in vba

    I am trying to insert a formula using vba but it gives me a syntax error, what is wrong with this line of code? .range("C11").formula = "=IF(A11="","",IF(COUNTIF(Sheet2!$G$87:$DO$97,A11),"Public Holiday",IF(WEEKDAY(A11)=1,"Sun",IF(WEEKDAY(A11)=7,"Sat","Mon-Fri"))))"
  15. K

    Can someone help me with my coding to return error box only one time and also to create msgbox as Critical?

    Hello, I am attempting to create an error message msgbox in an Excel workbook/worksheet. I have the coding to create the msgbox but if the error is on the worksheet multiple times, it shows the error multiple times. I have tried using alreadyprompted coding to stop this action but I'm having...
  16. I

    pi>Visible <Type Mismatch>

    Respected gurus, experts and MVPs, I have written the following code for the pivot table and it is generating pi.Visible <Type Mismatch> error. Sub piVisibleMismatch() Dim lastrow As Long, endrow As Long Dim Psheet As Worksheet, Dsheet As Worksheet Dim Pcache As PivotCache, Ptable As...
  17. L

    custom format, M has to be "M"

    Hi I have number between 1M to 10M. So I wanted to format to show 1 M instead of 1 000 000 So I went to format cells-->custom and typed #,, M But excel gave me error message I had to write it like this #,,"M" Why is that? If I wrote #,,K excel wont give me error message. So only when I...
  18. S

    Repairing Hyperlinks in a Workbook

    Greetings, When Excel crashes my hyperlinks placed throughout the workbook break. I am trying to create a macro that will fix the paths of all the broken hyperlinks. This is what I have: Dim hl As Hyperlink For Each hl In ActiveWorkbook.Hyperlinks Debug.Print hl.Address...
  19. A

    Populate Range from string

    I'm passing a Range to my Form via a Property Dim Rng as Range Public Property Let rRange(z as Range) Set Rng= z End Property Then I attempt to populate that range (which is a single cell) Private Sub cmdApply_Click() Worksheets("Sheet1").Range(rng).Value = Me.txtTest End Sub I get error 1004...
  20. A

    Range Code Fails reading Comment text

    Just wondering why this goes to error 91 "object or with block not set" Dim MyRange as Range Dim a Set MyRange = Application.Range("Sheet1!A2:G2") a= MyRange(1).comment.text ' Set a= MyRange(1).comment.text Both 'a=' lines result in the same error 91 Thanks.

Some videos you may like

This Week's Hot Topics

  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • find many based on a certain criteria
    good evening, I hope someone can help me? I have a workbook sheet 2 contains lots of data.... I would like to be able to find anything on sheet...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
  • Text Format
    I have a sheet for user to keyin the data. The format of the data can be 451 / 1903, 0012 / 9908 or 00287 / 0099. The number after the "/" is...
  • Macro to copy values across rows and transposing them and add the user id
    [FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]Hi,[/COLOR][/SIZE][/FONT] [FONT=Times New...
Top