loop a macro

  1. P

    Adding Loop to a recorded macro

    Hi All, Need your all help to add Loop in this Code. I've list of 50+ clients for which I've to send reports every Month. I've tried coding for 2 clients and its working fine but I've to do it for 50+ Clients, also file name should be same as C1, C2.... C55 in TMP file which I've already done...
  2. T

    VBA to deal with row based on cell value then move to next row

    I have a sheet of data that needs each row to be dealt with a certain way. To assist with this I've added a helper column (U) which is a vlookup to a set of conditions. the cell value from U10 downwards returns a value 1-6. The formula gets pasted into column U, so the next blank cell (usually...
  3. C

    Find and replace from access to word

    Hi all just recently migrated to access still learning hoping somebody could point me in the right direction. So I have a table containing property serial number as well as location information for inventory purposes. What im Trying to do is figure out if theres a way to loop thru each...
  4. C

    Loop Though all worksheets in work book

    HI all i know I'm missing something very small but i'm lost, i have the below code that i need to loop though every worksheet in the workbook, but it only works on the worksheet i'm on what am i missing Please Sub Copy() Dim WB As Workbook Dim ws As Worksheet For Each ws In Worksheets...
  5. J

    VBA Macro search match twice 2 keywords same column and copy result to another sheet

    Hi internet peeps. I am stuck i don't know what code to use so i can search the same column twice for 2 different keyword and then copy data from the same row to another spreadsheet in sequence from a start cell. for details here's what i am trying to do 1. Limit the search within a range of...
  6. 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...
  7. 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...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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"...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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?
  20. 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...
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

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
Top