vba

  1. B

    Simple CountIf VBA

    Hello, I'd like to transfer this macro recorder into an unlimited cell countif in cell E2. I don't see where my value in "a2" is being recorded? Range("E2").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=COUNTIF(C[2],RC[-4])" Range("E2").Select...
  2. L

    Pass data from a userform to a variable within a macro

    Hi! I'm working on a macro which graphs columns selected with an input box, and I'm trying to change these input boxes to userforms (in order to decrease the amount of popups for the user). However, I'm unsure of how to assign cells selected in a userform to variables which can be used in a...
  3. D

    Create macro that sends out emails when quantity is less than or equal to minimum stock

    Hello everybody, My current excel-file looks like this: I would like to create a macro that, once I click on it, checks if the quantity is less than or equal to the minimum stock. So in the photo, for row 2 where material number "6046100" has a minimum stock of "1" and the quantity on the...
  4. W

    VBA CODE to vllokup and get multiple results

    I have a requirement where there are set of values in A column of sheet1. These values in column A are mapped to multiple values in sheet2 of A and B column. I need a VBA code where it gives me the unquiet list of mapped items in horizontal manner. So the result must reflect in B2, B3, B4 etc...
  5. Elaszat

    Labeling tool hiccups

    Hello, there is a problem I have with my labeling tool I wrote for Excel. I'm afraid I have to go a while back on that. I'm working in an office where we have to print labels for our articles that we sell. It used to be a tedious process with lots of folders of examples on how to write the...
  6. V

    Passing Texbox string array to countif formula in Excel

    Trying to get an Array to work with Formula Countif, but cant manage to get the countif right, can anyone give me a pointer please? I have a userform with 5 textboxes on it add a search word in 1 or maybe 2 i wanted them to use the countif formula. Sorry if this seems simple to you guys im...
  7. C

    Combine lists with similar headers

    I have a spreadsheet with hundreds of lists that each have a header and vary in length. The headers all follow a similar format (ABCD 123AB) and I want all columns for which the headers share the first 8 characters (including the space) to be combined into a single column with the header being...
  8. E

    Macro to copy tab from closed workbook not working

    Hi all, The below code doesn't seem to be working: Sub CopySheet() Application.ScreenUpdating = False Set closedBook = Workbooks.Open("C:\Users\040429\Documents\Workings\Excel\_Holidays_.xlsb") closedBook.Sheets("Holidays ").Copy Before:=ThisWorkbook.ActiveSheet...
  9. S

    Protect/Unprotect worksheet VBA BUTTON?

    Hello all, context: I have created an employee holiday/leave sheet on (we use Excel 365) I have made a sheet for each month and they require 'protecting' and 'unprotecting' seperately/individually - with a password query: My team is not so computer literate so, I need to create an easy to...
  10. D

    Convert Excel to PDF before sending out automatically by email

    Hello Everybody, I am currently trying to create an Excel macro that converts my excel sheet into a PDF file and then sends it out by email. My current macro can do this, but it cannot convert it to a PDF file. I tried to merge my current VBA formula with the one here: to convert my excel...
  11. U

    If criteria1 does not exist then...

    Hi all, This is a pretty common question but I can't seem to find a solution that works for me. I have the following code that is supposed to apply autofilter but if the criteria does not exist, I want it to turn off the filter and end if. However, the line If currentBoxRange.Offset(-1...
  12. B

    Can I use VBA to make my printer print borderless

    I have a spreadsheet with 4 different tabs, the first of which is a cover page with a picture added to the header. This picture needs to be printed as borderless, which I can do manually each time, but for some reason this resets when I close Excel and reopen. Is there any code I can add to...
  13. A

    Running macro after data retrieve is slow

    Hi All, I have a MS SQL stored procedure returning data to excel. After retrieval I carry out some actions using a macro. When I run the query and then run the macro, the macro takes a long time. If I run the query save, close and reopen the workbook and run the macro first, then it executes...
  14. F

    VBA - 1004 Error #Ref

    Hello, I'm back again, let me just say that I found this website to be very helpful. I currently have a script that was created by an external source. I don't have access to that person anymore. When I try running the script its returning a 1004 error (see attachment). From what i can see...
  15. R

    How to change tablestyle with VBA without knowing the name of the table?

    I am trying to make a personal macro so that whenever I want to change the tablestyle of the table I have the active cell in, it will change it to the style I've designated in my code. For example: Sub OrangeTable() Range("B4").Select ActiveSheet.ListObjects("Table1").TableStyle =...
  16. S

    Find and Replace Across Specific Sheets based on a Data set with correct names

    I have a list of correct and incorrect names as seen in sample file below. I am trying to loop through a list of sheets and do a find and replace for each item on the List. The Correct Name is what the replace is going to be and the Incorrect Name is the find. I have looped through specific...
  17. C

    Adjusting Height of Offset in VBA

    Hello! I am trying to convert a formula that searches filtered data into VBA code and I'm having some trouble with just one portion of the conversion. The Excel formula is: =VLOOKUP(G4 & "",IF(SUBTOTAL(3,OFFSET(SomeRange, ROW(SomeRange)-ROW(D2),0,1))>0,AnotherRange),2,0) My Current VBA...
  18. E

    How to copy (with a macro) formulas from a row down based on if values exist an that row on another tab.

    Hello again. I need to copy a row of formulas from a specific row (Row 16) down but only if there is data in a specific filed on another tab. To explain a little bit better. Some people fill in data on a specific tab (Tab 2) Other people fill in data on tab 4 My formulas concatinate and/or...
  19. G

    Hyperlink for first column of each row running a macro ?

    Hi First up all thank you very much for this wonderful forum. I am not good in vba. so I need help from you wonderful people here. I am looking for something like this I have an excel file which contain two sheets. The first sheet contain my data in rows, the second sheet is a template which I...
  20. A

    Conditional formatting failing in one cell when numbers treated as text

    Hi all I have a SQL back end database, with an Access front end. One of the many things the Access application does is create a report in Excel by taking a SQL view, and exporting it, then doing lots of formatting and generally improving its appearance. The database is designed to record...

Some videos you may like

This Week's Hot Topics

Top