define

  1. rjplante

    email message body

    I have some html code in cell Z1. I used Dim EM_Body As String to define my variable. I then use the line below to define my variable. When I run the code I get a Compile error - Object required. What do I need to do to get this to run correctly? Set EM_Body = Sheets("Transfer page for...
  2. S

    macro may not be available - Problem

    Hi Team, ich hab viel nachgelesen, aber komme leider nicht weiter. Problem: Mein Code funktioniert wenn ich ihn manuell aus dem Editor abspiele. Wenn ich den Button klicke oder ihn über Alt+F8 abspielen will nicht. Andere Codes aus dem Modul funktionieren (Einfache Codes, die auch anders...
  3. J

    VBA Define variable

    Have a column A with a lot of account numbers in acending order. Want to define in VBA the row number, that matches the criteria: The row in column A should have the highest number closest to 4000.
  4. J

    Simple VBA query

    Hi I have a very simple query for something I am trying to do in Excel using VBA and hoping someone can help In a spreadsheet lets say I have the following values in cells B5:B10 A B 5 4 6 9 7 5 8 6 9 11 10 5...
  5. U

    Vlookup & Cut Row

    Hello, bit of a VBA newbie here coming for some (hopeful!) guidance. Below you will find my code for an ongoing project I am working through. My goal with this macro is to update the master sheet off a generated report that is sent to me using Vlookup. If the lookup value is found on the...
  6. J

    How can I define a subfolder?

    Hi, in this code below I have got a popup that has the user select a folder which is defined through the rest of the code as 'sFolder'. In one of the lines, you can see sFoldersubfolder = ?????. I would like to know what you would put to define each of the sub folders in 'sFolder'. Dim sFolder...
  7. K

    define range using sheets

    Hello I am trying to define a range using the sheets assignment like below Public Sub TEST() sh = Sheet1.Cells(4, 3).Value Set rngChart = Sheets(sh).Range(Cells(8, 1), Cells(209, 44)) End Sub I get an error. what am I missing? Thanks
  8. H

    Range.Formula Question

    Why does this: Range("E3").Formula = "=IFERROR(VLOOKUP($A3,Calculation!A:B,2,FALSE),"")" Give me an object define error, but this: Range("E3").Formula = "=A1+B1" Works perfect? Thanks
  9. V

    Advanced filter criteria

    Hi, I am attempting to create a macro that will define the criteria that will filter my data. below is what I have started with but not sure where to go with it Sub advanced_filter()' ' advanced_filter Macro ' ' Columns("A:A").Select Range("A1:A33508").AdvancedFilter...
  10. B

    Defining first part of file name

    I have a macro that creates a copy of 11 sheets within a workbook and creates a new workbook for each of the 11 sheets. The macro then saves each workbook with a specific name e.g. Bob, John etc etc. What i'd like is at the start for a text box to come up so that the user can define the first...
  11. S

    Plot graph using cell adress instead of cell values

    Hello I have to hundreds of columns and I have to create a graph for each one of them, so I created the following macro to save me some time: Sub PlotC() ' ' Macro PlotC ' a = Range(ActiveCell.Offset(1, 0), AddressveCell.Offset(0, 0)) b = Range(ActiveCell.Offset(2, 0)...
  12. D

    v-lookup, match, index combo to return 1 of 3 diff types of statuses

    I'm looking for 1 of the 3 types of statuses (Not Started, Pending, Approved) according to the project ID, project Name, and the current phase Define (in header) from worksheet 1 and value to be returned in worksheet 2 Worksheet 1 - formula in cell C2 <tbody> A B C Column Headers Project...
  13. Z

    vba out of memory error

    Do anyone know how I can simplify this codes???? Private Sub CommandButton2_Click()'Declare the variables Dim AddData As Range, Current As Range Dim user As Variant, Code As Variant Dim PName As Variant, AName As Variant Dim ws As Worksheet, ws2 As Worksheet, ws3 As Worksheet Dim result As...
  14. C

    Data Validation using a Named Formula

    So I am using data validations to create drop down menus, however they act dynamically, and so the list generate depends on the value on the current sheet. To do this i select the cells i want to add the data validation to, and then select data validation from the toolbar, then set Allow to...
  15. M

    VBA Next without for complie error

    Hi there everyone, I've recently been trying to learn some basic vba to help with duties at my work. I've been following some youtube videos and came into a problem i cant seem to find the answer for. I keep getting a 'next without for' compile error. I know its because i was following youtube...
  16. D

    Define many names for many ranges of cells

    Hi there, This may require a macro, but i have 2 columns of data that comprise of many groups of the same name in column a, accompanied by a date of a test result in column d, ie, a d x dec 1998 x nov 2001 x aug 2007 x jan 2009 y jan 1996 y nov 1999 y jul 2002 y jun...
  17. M

    Non-existent Excel Worksheet, but Formulas and Defined names still work?

    Hi Everyone, I have an Excel file that is referencing a non-existent worksheet. But the formulas and stuff still work just like nothing is broken (no "#REF" appear). How is this possible? E.g. Worksheet A! has a VLOOKUP formula referencing a Defined Name in Worksheet B! which is a table range...
  18. J

    Autop update Data Validation lists from another sheet

    Hi all. Im new to this forum. I have tried looking for the answer before posting this as I realise this question has been posted a few times, but I can never get the example formulas to work on my spreadsheet. So, I will post the scenario and exact cell ref's Im using, in hope that someone can...
  19. S

    Define workbook name as variable

    Hi, I wish to set up a macro in a workbook - reports. This will copy info from another wb many times - results. The name of the reports wb will change. Therefore I wish to declare the wb name when I run the macro. I have tried the following. The workbook name is returned in D3. Dim Reports...
  20. K

    using variable across workbooks

    How can I (if it's possible at all) set the value of a variable being used in one workbook, and have that variable retain its value in a sub in a different work book. eg.. sub code1() x = 5 application.run("'Path\of\different\workbook\name.xlsm'!code2") end sub [then in the other work book]...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top