loop a macro

  1. C

    Loop to Table of Contents is skipping rows

    Hello, I have a macro to loop through all of the sheets in my workbook and return those sheet names with hyperlinks and some more additional info to a "table of contents" sheet. But i have it skipping some of the sheets that I don't want included in the TOC. As a result, it is leaving blank...
  2. B

    Loop until blank

    Hello guys, hope you're doing good So my problem is i have a task at hand with complex features or codes. I found the codes seperately and every one works good but when I try to add them together the code does not work. I want to fill a template according to ce cells and print the template and...
  3. P

    Loop Causes Excel to Shutdown after 10-15 iterations.

    Hello! I've been running into an issue with a loop macro that after about 18 iterations it just shuts down. I have it Calculating a couple of times so that the values update correctly. One of things being updated is a dynamic named range that was made with indirect(). What can I do to clean...
  4. V

    VBA Loop that sends emails via Outlook with a PDF attachment is being considered "spam"

    Hello, I have a pivot table in Excel. I created a loop that selects 1 filter of the pivot table. For each loop it creates a PDF on my desktop, then takes it as an attachment, sends an email in outlook, deletes the PDF, then goes to the next filter on the pivot table. Its probably sending 300...
  5. R

    Running macro through files in different locations?

    I hope someone can help with this: Is there a way I can get the same macro to run for about 25areas in separate subfolders? ...\Area1\list.xlsm then ...\Area2\list.xlsm .... either by listing the "list" files and paths in VBA and looping through, or by another more efficient method? (Areas...
  6. S

    Reduce time taken for VBA loop

    My VBA code currently loops for 5,000 iterations and takes about 25 minutes to collect the output data in the Output excel sheet. Is there a way to reduce the time taken for instance by improving the copying and pasting of values, collecting the output data in some kind of array etc.? Given that...
  7. V

    Macro To Extract Data

    I have a workbook that houses detailed metrics by project. In the front of the work is a summary tab with subsequent worksheets for the individual projects. I want to write a macro that will extract information from the individual project worksheets into the summary tab. Example: Row 1...
  8. R

    Loop not working/crashing

    Hello everyone! I am a pretty beginner vba user and having some trouble getting a loop to work. I have a pretty extensive formatting code here, which works perfectly on a single worksheet. When I then try to have it loop through every single worksheet in the workbook except for the "Original"...
  9. D

    Excel Ninjas: Loop Copy/Paste Category Types at Row Level

    Hello, I am trying to create a macro that does the following: Loop down sheet and copy the Description (Column E) Ex: Copy "Cash in Bank" [Note: the empty cells at the category description level (Beg and End)] Paste the description in (Column L) next to each transaction Ex: Paste "Cash in...
  10. D

    Writing txt. logs during a loop

    Need the following code to produce a txt. log on an error, but return the loop interger it was using when the error occured, then retunr to the loop. Sub email() Dim OutApp As Object, OutMail As Object Dim strbody As String Dim cell As Range Set cell = Range("J1") For i = 1 To cell.Value...
  11. C

    Barcode Scanner Macro

    I'd like to setup some sort of a macro in excel with a barcode scanner I have. We have a factory with a large number of machines which are all bar coded that also have travelers with the production order in a barcode format. Right now someone walks the line and manually writes which work order...
  12. M

    Delete row in Book 2 depending on value of cell B4 in Book 1 - VBA

    Hi I need to write code which loops and deletes rows in a workbook (let's call it Book 2), if the name of a row in column A in Book 2 is the same as the name of cell B4 in Book 1. Please find below some sample data. For Book 1, the name in cell B4 is "Coffee" in this example (but it could...
  13. D

    VBA LOOP Help

    Hi all, I have a repetitive process that I am trying to automate which consists of the following steps: 1) Take 5 pieces of data from a record on worksheet A with 200 records and input those pieces of data into worksheet B 2) Take Worksheet B and save the tab as a PDF in a new location 3) Name...
  14. R

    List Boxes Font Size

    I have 42 list boxes. When the file is opened on a different PC and then i reopen it on mine the font shrinks. Is there a way to loop through all 42 boxes when the file is opened and set the all to font size 24?
  15. T

    open a txt file, edit it, then save it as an xlsx, then repeat for 200 additional files in the same folder

    The below code works great... for ONE file. But the files are from 1800.txt to 2000.txt. How do I insert this into a loop so I don't have to enter a filename? It just opens every txt file in that folder, parses it, then saves it as the same name but as an xlxs file? Again, C:\temp\ contains 200...
  16. M

    Loop through sheets with Call macro's

    Hello, I'm trying to make this code work for all my sheets. But after trying for several hours I give up. The problem seems to be that the code doesn't loop through the sheets. Sub NaDataInvoegen() Application.ScreenUpdating = False Call VerwijderMonstervoorbewerking1 Call...
  17. D

    VBA Code for BOM

    <tbody> Sr No Level Item ID Revision Description Ext Qty UoM Cost Extended Cost Make/Buy </tbody> So I have these columns in my PBoM sheet. I want to write a code using if and loop statements. Criteria is that if there is a Make in Column (Make/Buy) then it should add all the extended...
  18. N

    Dynamic Loop + Dynamic range to sum

    Thank you for reading my post, I am new to VBA and macros... I am having difficulty trying to solve the loop and dynamic sum value As you can see I would like to have sum the values in blue and have the total in orange but I am having trouble to sum it up at the macro since it is a dynamic...
  19. M

    Need a way to repeat a step x amount of times in VBA - Loop

    Hi, I have a spreadsheet which has a sheet which contains formulas (called 'Formulas') which are based from an input sheet. There will be a variable number of lines within this sheet based on the data in the input sheet. At the min I have a macro which takes the information on my formulas...
  20. A

    Looping Macro That Changes The Value Of A Cell Based On Another Cell

    Hi experts, I have a spreadsheet that needs a rather complex macro solution, for someone like myself at least. I will try to explain as simple as I can and provide as much clarity as possible (please see the file in this provided link as you go over the below inquiry) Goal: Elimination Of...

Watch MrExcel Video

This Week's Hot Topics

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