compile

  1. S

    Vba learning

    below is my code which stops at the red word and gives compile error as shown below. [CODE][Sub inputbox() Dim myvalue As Variant myvalue = inputbox("Give me some input") Range("a1").Value = myvalue End Sub /CODE] Compile error: Wrong number of arguments or invalid property assignment
  2. T

    If ... Then statement Compile Error

    Im getting a "Compile error: Expected: Then or GoTo" in an If ... Then statement. My worksheet comes from a data logger that can record 20+ channels of data. The number of channels and channel numbers can change depending on the setup. If the channel is not being recorded the column header is...
  3. S

    HELP: Compile Sheets Into ONE Tab

    VBA: Compile 5 out of 10 sheets into 1 Hello! I have made a macro to basically take 5 data sources and order them into new order by headers. Now I have 5 sheets into a workbook of 10 that is set in the same order with same headers. Is there a macro out here that would compile the 5 sheets...
  4. M

    Using variables in a Range

    Hi I am trying to write a formula in a range. I am suing the code below to define my range: range("b" & m + n + 11&":k" &m+n+11) m, n are defined as integers VBA doesn't seem to like it. It highlights ":k" and comes back with the message: "Compile error: Expected: list separator or )" Can...
  5. B

    Compile error

    Hi all, I keep getting compile error "End With without With" with: Private Sub CommandButton1_Click() With ActiveSheet If OptionButton1.Value = True Then .PageSetup.PrintArea = "$a$1:$z$55" .PageSetup.Orientation = xlLandscape .PageSetup.LeftMargin =...
  6. B

    Compile Error: Variable Not Defined

    Hey there! I am trying to get some code to work and had a friend help me try to clean it up. It worked when he ran through it, but now I am getting a Compile Error. I have made the line where the error occurs bold. The string of code is as follows: I would also like to add that I renamed...
  7. N

    Compile Error: Invalid qualifier

    My code is : Sub Calculating() Dim header As String With header.Range("A1") = "Name" .Cells(1, "B") = "Class" .Cells(1, "C") = "Subject" .Cells(1, "D") = Range("d1") = "Marks Secured" The above code is causing to throw error as...
  8. P

    Compile Error - Automation Error

    Hi the following code is producing a "compile error - automation error". Any help would be appreciated Public Sub addmilestone(shapeleft As Integer, shapetop As Integer, shapeheight As Integer, shapewidth As Integer, shapecolor As Long, shapetype As MsoAutoShapeType)...
  9. G

    Compile error notice

    I have a spreadsheet with lots of VBA in it that I've used for a number of years. Recently it produces an error message when I open it - Compile error- Automation error. When I ok it, the VBA editor opens with this line highlighted in blue: "Dim workbook1 as workbook" (Dim is not highlighted)...
  10. A

    compile error: argument not optional

    Hi guys, i may need some help here. I'm new to VBA excel and want to save the data directly into MYSQL database. But i have encounter some compile error with argument not optional. Here's my below codes: Sub dbConnect() <--- error from here Dim conn As New ADODB.Connection Dim iRow As...
  11. T

    Compile Error: Expected List Separator or ) when trying to get a range

    This is giving me an error Worksheets("Sheet1").Range("A" & i&":B" & i).Cut Compile Error: Expected List Separator or ) please help
  12. M

    Ambiguous sub name

    Hi I created a Sub name but Excel stopped the code from executed and said "Compile error: ambiguous name detected: SavingANewlyCreatedWorkbook" The sub name is below - any ideas why? Sub SavingANewlyCreatedWorkbook()
  13. L

    SUMIFS in VBA

    Can anyone explainto me what is wrong with this Formula. =SUMIFS(F760:F841,B760:B841,"A",I760:I841,"B",J760:J841,"C",K760:K841,"D") On a worksheet it works without issue. When I try it in VBA it gives the following error. Compile Error: Expected: List Separator or). The colon between F760 and...
  14. S

    Compile Error: Sub or Function not Defined - GoTo

    Greetings, This is what I'm working with... If Range(Cells(k, b)) <> "" Then GoTo First Else GoTo Second First Set h = Range(Cells(k, k.End(xlToRight))) k = k - 1 End If Loop Second h.Copy...
  15. andrewb90

    Compile Error on startup

    Hello all, When I open my workbook, my opening code doesn't run and I get an error stating: "Compile error in hidden module: ThisWorkbook..." Any ideas what could be causing this?
  16. D

    VBA Code for a print button

    I have setting up a siple print button where on initiation the macro prints a range of cells on a speciic worksheet in a workbook. But I have been getting a compile error. I just cannot see whats wrong...any suggestions? Sub Print_Invoice() Sheets("PreSchoolInvoice").PrintOut...
  17. R

    Creating summary file from multiple workbooks created on specific day

    Greetings all, I have an analytical piece of equipment that exports data for each sample analyzed into a separate .txt file. I would like to compile all of the data from analyses performed on one day into one summary workbook. All of the exports are in the same format but the location of the...
  18. D

    Compile Error

    I'm new to VBA in excel, I'm getting a compile error with the following code: Range("M1, N1, O1, Q1, S1, T1, U1, V1, W1, X1, Z1, AB1, AC1, AD1, AE1, AF1, AG1, AI1, AK1, _ AL1, AM1, AN1, AO1, AP1, AR1, AT1, AU1, AV1, AW1, AX1, AY1, BA1, BC1, BD1, BE1, BF1, _ BG1, BH1, BJ1, BL1, BM1, BN1, BO1...
  19. D

    Compile Error to working VBA when new module added

    Trying to incorporate two modules into an excel sheet and am running into an issue that I haven't been able to diagnose. Independently the modules work but when both are in the file it gives me a "Compile Error: Wrong number of arguments or invalid property assignment" with the Sub line...
  20. D

    Compile Error: Expected: Expression when creating Outlook and building email line by line

    Compile Error: Expected: Expression when creating Outlook and building email line by line Trying to have a standard body/header, and insert line items based on excel values (If 1 include line A, if 2, include line B, etc.) ANY feedback or advice would be greatly appreciated. aEmail.Body = "Hi...

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