loops

  1. S

    Looping through all files in a directory, but open file does not loop

    Please help, my issue is that the code below works but not for active work book, so when i run the macro from the a open workbook in the same directory, it works for all the files but not for the one thats opened and im running from... i want it to run for the file thats open too. Allfolders...
  2. P

    Using an arry to index nested for loops

    When I use an array to index a set of nested for loops, I get an error ("For control variable already in use"). See this short script, for example: Sub testArrayFor() Dim myArray(1) For myArray(1) = 1 To 2 For myArray(0) = 3 To 4 MsgBox myArray(1) & myArray(0)...
  3. E

    Substring Search !

    Hello! So let's say I have: Dim MainString as string, Substring as string Dim Result as Boolean MainString ="ABCDE|ABCDF|CGHMN|QRSTU|CJKLM" Question: Is there an easier (faster) way to check whether MainString contains all elements of Substring without using loops? Example 1: If Substring...
  4. D

    Help with some code

    Hi Guys, I'm trying to rearrange some data and having trouble with getting it to correctly loop through a list. Basically I have data in columns 1-39 with no gaps. Column N contains names. I am trying to create something which takes the name on any given row (From N2 down) and searches for...
  5. A

    Nested for Loop

    I can't seem to figure out how to jump to the next "c" in the loop after pasting my data. it works the first time but does not return to the first loop to change the c value to continue the process. any help would be great Sub CopyPasteData() Dim Pool As Worksheet Dim Family As Range Dim i As...
  6. H

    Problems with offsetting loops on excel vba

    Hello everyone! I have a small piece of code that will be used to compare a column (D) with the values of columns A B and C. It will later compare the column E with B and C. One of the objectives is to compare each cell from D and E with the correspondent cells in A B and C. Example: If D1...
  7. S

    Insert Sheet Name for each cell in range

    Hello, I need help creating some code that will automatically fill in each row with the sheet name. I receive a workbook weekly, with about 50 different sheets of data I need to analyze. Doing this manually is very time consuming. Ex: Sheet1 is Named KEL01, i need KEL01 filled into every...
  8. montecarlo2012

    vba add-ins

    Hello. It is possible to code an Add-in that make possible to write it down, the conditions, loops and with; in other words, you know that when we type sub automatically the IDE write End Sub, so I am wondering if it is possible to write a add-in for the conditions, we just type If and the IDE...
  9. T

    Automate sparkline creation (loop help!)

    I have a spreadsheet which consists of two sheets - a summary sheet and a data sheet. On the summary sheet I have a unique list of names that exist in the data sheet in column A, and in the data sheet, there are multiple rows per name (column A) and a number next to each one which denotes...
  10. D

    Combining Do Loops with other Macros statements

    Hello all, I am looking to make 1000+ reports based on a template. I have other sheets referencing the target city to update the data they report on. I have a master macro that calls on three other macros to format accordingly and save as "Location Report- Austin 1". After creating the Austin...
  11. T

    Loop Updates

    Hi All, I am looking to use a loop to update a name within a cell if that name changes and this is the logic behind how i see this working. E.g. Sheet 1 cell E4 = New name Sheet 1 cell M45 = Old Name then if New name <> old name Find old name in sheet 2 (column b, data...
  12. D

    I want to speed(clean) up my code with loops

    I have 16 different blocks of code that have the same structure as below. Is there a way to speed this up and make it cleaner with loops? Thanks :) ActiveSheet.Range("D8") = reg1 ActiveSheet.Range("D9") = reg2 ActiveSheet.Range("D10") = reg3 ActiveSheet.Range("D11") = reg4...
  13. M

    VBA - Delete a range of rows if column contains a specific range of data

    Hi all, I am looking for a code that can delete a range of rows when the find condition is met,that is the string " Configurable" is found and then all the rows including configurable and exluding the number "2018". the dataset is setup as csv within the first column file. the first range of...
  14. B

    Creating a loop using a list of values with Excel Macro/VBA

    I have a list of values in cells A1:A10. I want to create a macro so that cell B1 will first contain the first value in the list, then the second value replace it, then the third, and so on. Once the entire list is run through, it should loop back to the first value again. The same...
  15. D

    Renaming Files Loop order - MS Scripting Runtime

    Hi I am having a bit of a brain fart on this particular problem when it comes to ordering my loops correctly. I have a folder of scanned invoices (file names are sequentially numbered), I also have a spreadsheet which contains the invoice numbers in column A and a Page Count in Column B (one...
  16. iknowu99

    recursive nested loops

    Hello MrExcellers, How would you create function that takes the parameter to make calculation of nested loops. Specifically the repetition of "for " line reproduced inside function? For ex: for a=1 to 10 for b=1 to 10 for c=1 to 10 for d=1 to 10 'calculations next d next c next b next a as...
  17. D

    Adding to the 20th visible row

    Hi all I’m looking to be able to either amend the code below orhave a new code that loops through the range and identifies every 20th visible row (after the header) and adds “yes” to column “S”. I've been able to find an alter code that identifies andselects the first 20 rows but I’ve got to be...
  18. T

    VBA Macro for Counting with while and nested if

    I am trying to create a macro that does the following. while each one of 10 columns doesn't contain a red colored cell count the # of yellow cells (highlighted through conditional formatting) find row with max # of yellow cells turn them red display name of rows that turned red end the cells...
  19. A

    Auto Create Charts from Different Rows in Excel

    Hello! I'm very new to VBA and have managed to create most of what I need; but am stuck on the hardest part IMO - Looping through the rows to create each chart. What I'm looking to achieve: Creating a chart for each row of data in my excel sheet. Each row of data has three years of monthly...
  20. C

    Filtering Data based on previously filtered data selection

    Hello, I'm attempting to put together a Holiday Staffing Planner the returns certain values and hourly counts based on data input and filtering from other worksheets. My workbook has the following worksheets: * Holiday Staffing Planner - (User Input Worksheet) * DD_VALUES - Data Validation...

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
Back
Top