syntax error

  1. H

    Formula Syntax Not Correct

    hi I am trying to have a cell calculate the profit or loss of 2 cells based on a Dutching calculation. Dutching basically just means that if either of the 2 selections has W in row V, the profit is the same regardless of which one has the win. If there is a W in either cell, then the following...
  2. D

    VBA code, subtracting a value from a non 0 range value

    Hello All, I'm new (as in just the last couple of days) to programming in general let alone VBA, but I'm learning. This site has helped me tremendously on a number of code snippets I've been struggling to get right. Anyway, I'm making my next years time sheet for work as I do every year to...
  3. M

    Import CSVs Macro Error Troubleshooting. Please Help a Newbie Out!!

    Hi all! I'm super new to macros/vba and am working on a project for work that requires me to import csvs from a folder into a specific workbook. Each csv will need to go into a new sheet of this same workbook. I read around on the site to get the code I need to pull this off, but for some...
  4. S

    Syntax error

    Hi, When copy the following direct into excel i dont get any errors, works perfectly but if i put it into a module and run it, i get syntax error... =average(INDIRECT($A2&"!a:a"))*SUM(INDIRECT($A2&"!B:B"))+1 But VBA it doesnt not allow me, what am i doing wrong? Range("E2").Formula =...
  5. N

    VBA InStr() Function Nested Or/And Issue

    I can't seem to get the syntax right on my nested OR/ANDs section so I keep getting an error - please help! I'm sure there is a better way to do this than having all the InStr() OR InStr() but I'm not comfortable in VBA at all so I dont' know very much <code style="margin: 0px; padding: 0px...
  6. V

    Help with SQL code within Excel

    Hi guys, I hope you can help me with the SQL query below that I am running in Excel via the Data->Connection, error: Syntax error in FROM clause. Long story short, I used to do a data dump from our database into MS Access and then run the SQL code below from within Excel. It still works nicely...
  7. C

    Help with Marco

    Hi, I want my macro to populate column 'N30:N30000' with my formula. However, for some reason it won't compile the macro due to ' Syntax error'. Any ideas how to resolve this: Sub FillDown() Dim strFormulas(1) As Variant With ThisWorkbook.Sheets("Sheet1") strFormulas(1) =...
  8. D

    Run-time error: '1004': The syntax of this name isn't correct

    Hello all. I've been banging my head against the wall on this one and I finally threw my hands into the air. I definitely need more brain power than I obviously have going on now. My VBA code Creates a new worksheet, names it via an Inputbox function and "supposed" to create three new named...
  9. S

    Having Subquery Trouble

    I have the following query: <tbody> Item No Item Class Dept Code Quantity 0001 Raw Material 1 50 0001 Raw Material 2 30 0002 Raw Material 3 100 0003 Raw Material 1 75 0003 Raw Material 2 100 0003 Raw Material 3 20 0004 WIP Item 4 100 0005 WIP Item 4 100 0005 WIP Item 5 175...
  10. V

    Simple conditional output failure aka Prediction Interval Testing - should be an easy VBA fix

    I do a lot of forecasting and am tired of having to repeatedly write a formula from scratch to test whether or not my forecasts fall within the prediction interval. To be clear what I mean, is that I may predict a value of 1,000 with an 80% chance it will be within 900 and 1100. I need to test...
  11. A

    Excel VBA Compile Time/ Syntax Error with a long formula

    Hello, I am trying to use a macro to remove middle initial (if it exists) from a list of names in column B. This formula is to be typed into cell D2. My formula works when I type it into excel, but not when I record it as a macro and run it. There is a compile time/syntax error. The code is...
  12. D

    SQL Statement giving "Syntax error insert into statement"

    First, I want to make everyone aware that I'm new to VBA, SQL, AND Access. Our data guy let suddenly so I've been given the job of maintaining my organizations databases even though my background is in Educational research. :eeek: So I'm sorry if I give too much/not enough information and if my...
  13. 0

    Compile Error: Syntax error

    Macro that generates emails with for a number of different people with predefined text. Error when trying to run. 'EMAIL TEXT With OutMail strbody = "Good " & g01 & " " & Range("C" & ActiveCell.Row).Value & "," & vbNewLine & vbNewLine & _ "<br/>" & _ vbNewLine...
  14. J

    Syntax Error - Insert Column Header (Good), Insert Formula in Row 2 (Good), Drag to Last Row (ERROR)

    Hello, any ideas how I can get the following code to work? I am adding a column called "Value less VAT", then adding in the formula in row 2, then attempting to drag it down to the last row. Everything works like a charm, except the dragging down portion. See details below. Code #1 = my code...
  15. M

    Long formula "Compile error: Syntax error"

    Hi There, I am applying a formula in excel and it is working fine. I am recording the macro with the formula and I am getting Syntax error. The formula is "=IF(RIGHT(TRIM(LEFT(F2,IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(IFERROR(FIND(".",F2,1),FIND("...
  16. D

    Hopefully Simple Question with a Simple Explanation...PLEASE HELP!

    Hi, I'm trying to nest an OR statement within an IF statement, with varying luck. ----------- The following example works: =IF(OR(H2="Apple",H2="ApplComputer",H2="APPLE CANADA DIV",H2="IPHONE",H2="MACBOOK"),"Apple”,"Other") While the below example does not and instead returns a #NAME? error...
  17. L

    “Unable to get the VLookup property of the WorksheetFunction Class” error

    Hi all, I am trying to set the values in column B in my Workbook "Copy of Dash Board Shell" (shown in the image below) equal to the value derived from my HLOOKUP function from my data workbook shown as second image below Copy of Dash Board Shell Data file so esentially the code will find a...
  18. Z

    Syntax Error Not R1C1 Problem. Manual formula work fine

    Hi all, I cannot fathom why this returns syntax error. I've done all the fiddles and bits I know and it still gives it me. The formula works fine when i type it in but when i do it in a macro. Nope. Ive typed the macro, I've recorded the macro. Nothing. Its driving me up the wall !!! Sub...
  19. R

    sql issue

    Sub output_into_files() Dim CONNECT As New ADODB.Connection Dim zapytanie As New ADODB.Recordset Dim path As String Dim name As String Dim a As Integer Dim sheetValue As String Dim QueryString As String path = "SOME PATH...." name = Dir(path) a = 1 sheetValue = "sheet" & a Do Until...
  20. M

    SQL Error in trying to fill formula down

    Hi, I have an issue with my SQL code below, in that I am trying to fill series the formula in column Y within my dynamic table. For some reason it doesn't like the format of the formula despite it working in the excel sheet itself. It appears not to like the "A" which is being added within the...

Some videos you may like

This Week's Hot Topics

Top