compile

  1. R

    Code works in debug mode but fails to run in compile mode

    Hi all I am writing a VBA code to copy charts from Excel to Powerpoint. The code is running fine in debug mode, however, gives an error in compile mode. Can anyone please help? Thanks in advance. MBSheet.Activate MBSheet.ChartObjects("Chart 1").Chart.ChartArea.Copy mySlide.Select With...
  2. J

    VBA compile error

    Get an error message: compile error: method or data member not found at each of the two lines starting with selection Sub Accrual_Provision() Sheets("backing").Activate ActiveCell.FormulaR1C1 = "Accrual October" ActiveCell.FormulaR1C1 = "=+R[-8]C[-1]/9*10" Range("F41").Select...
  3. V

    Compile Error- Sub or Function not defined

    Not sure what is going wrong with the following code, I am getting the Compile Error- Sub or Function not defined. I am trying to delete all rows which dont have Cell value Ed. Sub Macro1() Dim r As Long Dim FRow As Long Dim LRow As Long FRow = 2 LRow = 1000 For r = LRow To FRow Step -1...
  4. P

    Workbook_BeforeClose compile error: Variable not defined help

    What this code is suppose to do is look to see if any of the worksheet names equals Exhibit "I" or "page 2". If they do exist then before closing the workbook don't save it and then close the workbook. Actual First Worksheet Name is Exhibit "I" and the second worksheet name is page 2...
  5. R

    Newbie Access vs Excel question

    I have a client that has an excel report that hes wants to make easier to compile. He uses data from multiple diverse reports and uses at least 6 separate pivot tables and uses the resulting columns to compile this one report. I've been tasked with this job quicker and easier. My excel...
  6. C

    How to use AddressOf in VBA

    I have a timer script from the web that uses the AddressOf MySub as the callback. Apparently it worked for the person who wrote it. However, it fails to compile at least under Excel 2013. Is this keyword and functionality still valid in VBA? In 64bit? I can post the entire timer script if...
  7. P

    Compile Error on Sorting

    I'm trying to insert a line of code at the end of my macro that will sort the list alphabetically. I keep getting this compile error and it points to the word Key1 in my line of code saying that it expects the end of a statement With Sheets("Doc Checklist").Range("C2:C500").Sort...
  8. 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."...
  9. I

    Compile error "Subscript out of range" in simple set statement

    I'm obviously missing a fundamental concept. I have reduced my problem down to a few lines of code, and still can't solve it. Sub tstSbScrptRng() Dim wkBk As Workbook Dim sPath As String Dim sFile As String sPath = "C:\Users\ibud0\Documents\" sFile = "Garbage.xlsx"...
  10. P

    Compile error help

    Private Sub cmbSDPFLine_Enter() Dim i As Long cmbSDPFLine.Clear cmbPrdCde.Enabled = False cmbPrdCde.Clear txtbxPrdctNm.Text = "" WS_Count = ActiveWorkbook.Worksheets.Count For i = 4 To WS_Count cmbSDPFLine.AddItem Sheets(i).Name Next End Sub...
  11. Rymare

    VBA: Compile multiple workbooks to one sheet, unknown error

    I have some code that a lovely contributor on here was kind enough to make for me, and it takes a list of excel paths (which can be a long list or short), opens them, is supposed to copy all the rows that have data (because some will have more data than others) and then add them to the bottom of...
  12. P

    Compile error in email coding

    Hi, good morning. I have the code below which is just a small part of alot of code for an email, i am trying to add the part in bold to the code infront but i keep on getting a compile error, please can you help? any help is greatly appreciated. "<p>" & Me.TextBox3.Value & "</p>" & "<p>" &...
  13. H

    VBA - How to Clear ONLY bottom border of Rows in a range?

    I can set a border with: Dim rnge3 as Range Dim rowstart as Integer, rowend as Integer set rnge3 = Worksheets(3).Range("A" & rowstart & ":AU" & rowend) With rnge3.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = 3 End With But when I want to clear that...
  14. B

    Compile one list from multiple columns

    Hello, Is there a way to compile a single list in a single column from data that I get from another search? <colgroup><col><col><col span="2"><col><col span="7"></colgroup><tbody> Unit Number 255358 255358 272833 255370 272840 782673 271775 769525 PEC1783 271004 271004 769524 255379...
  15. E

    Using SUMIF with specific assigned values

    Hi! I'm trying to compile a total time for a job by referencing the name of the job's component. I'd like to be able to assign a value of 1 minute to "filing", 2 minutes to "retrieval", 1 minute to "processing", etc. and have the time compile based upon the job entered in the column. I...
  16. K

    count files in folder

    Sub Demo() Call CountfilesInFolder("C:\Users\kamal.j.kumar\Documents\CDP", "*.xls*") End Sub Hi, In the above macro, I get the following compile error: sub or function not defined. Why ?
  17. M

    Loop through sheets and add to array to select

    I have a number of worksheets and want to select all other than 2 specific sheet. I'm struggling to compile the code to basically say 'Select all sheets other then Sheet1 and Sheet2' TIA
  18. S

    Compile Error While Setting Range for Chart Source Data

    Greetings, I am receiving a compile error expected: = message after trying to set the source data range for an xyscatter chart type on the line below. I would like to use data ranges from another workbook "COMM_COMBINED.xls" and a worksheet by the worksheet variable name zz...
  19. 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
  20. 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...

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top