loop

  1. M

    VBA Question - Looping and Variable Table - Not actual table

    Hi, I am an amateur with VBA, but have been using MrExcel and various to put code together for a project I am working on. I am currently stuck on a part where I have 2 "Table" copied to a sheet. The "tables" are variable in the sense of Rows, since there could be 1 query on it or 10 for...
  2. Johnny Thunder

    VBA Help - Build Formula based on Variable Count

    Hello All, I am working on a project that has several macros but there is one piece of the puzzle I am unable to completed. I will do my best to explain what I need visually. I have a loop that looks at a sheet (Timing Assumptions) and based on a row called Percentages, the user is able to...
  3. G

    VBA Loop for copy and paste with search

    Hi There, Thank you in advance for taking the time to read this. I've tried to search for the answer but to no avail so I'm hoping some very kind person will be able to help put me out of my misery. I'm trying to search for a specific term within a column of a worksheet, if that is found...
  4. S

    Referencing a big number of ToggleButtons

    I have a table which has a ToggleButton next to each line. I would like to write a script that does something for each line of the table, but only if the ToggleButton on that line is pressed. Is there a way to define the if condition in an elegant way? I would imagine something like: For i =...
  5. B

    Reiterate group of columns based on cell value

    I have a start date and end date. For each quarter I want to automatically create a group of columns (L:Q). Once it gets to zero quarter remaining the program ends.
  6. N

    How do i put the last value of a loop from a vba program into a cell in excel

    i have a do while loop w a nested if statement, it is for iterations for the bisection method for finding the root of an eq. i woud like to know how to put the last iteration in cell C2 please an thank you
  7. E

    Use VBA to loop through all the .txt files in a folder, then transfer the content to an excel sheet

    This is the base code. This code works perfectly fine. It reads data from a .txt file and import the first 160 columns to an excel sheet. This code can be re-used on multiple files (doing data importing and appending). For example, the first time I run this code, it will import all the data from...
  8. G

    loop through text files using VBA and extract information

    I work for a sheet metal manufacturer and would like to use VBA to loop through a directory of text files (that are created as setup sheets when machine programs are generated) and extract meaningful information to Excel for further analysis. All of the text files are generally structured the...
  9. J

    Loop through Data Validation list in Advanced Filter Copy Paste all Results on one sheet

    I am having an issue with looping through my advanced filter that loops through a data validation list then needs to copy each filtered data result into one sheet, one after another. I am able to get the data validation to loop through each drop down selection and filtered each persons results...
  10. M

    Looping through a Column on One Sheet and Posting to Specific Cells on a Second Sheet

    I will try to simplify this problem so that maybe someone can provide an efficient solution. I am dealing with an accounting application that I created in Excel, and I cannot seem to get the data in the format that I need. The attached workbook is a simplified version of the application...
  11. Johnny Thunder

    VBA Help - Rewrite a For Each Statement

    Hello all, I am working on a project and realized I messed up one piece of code but I was able to spot the problem. Here is what I have come up with, I have a For Each statement that scans my data and when there is a negative amount in column ("H2:H" & LastRow) process a few actions +...
  12. N

    Loop Matching Arrays (sum values) - VBA Please help

    I have to match both columns below. To get a match you need to sum/combine some values in TC column and combine some values in AE column. (e.g-1 sum of Items 1 & 2 of TC Column (20,378) will match to the sum of items 2 & 3 of AE Column (20,378) e.-2 sum of items 15,18,19 of TC Column will...
  13. T

    Loop Input Box if Entry is Invalid

    I am wanting to restrict the user entering into the inputbox to one of four answers. If not, the inputbox will loop until one of four answers is given. The answer would include both text and a number, a1, a2, b1 or b2. Would declaring the variable as a string be appropriate? I figured I could...
  14. G

    Create multiple tables from one table based on change in field name

    I am trying to create a VBA loop in access that would take the below data from Table A and create new tables based on a change in General Category. We run this quarterly so we would want to delete the data in the "New Tables" created each quarter and populate with the most recent quarter's...
  15. E

    VBA to paste data if two cells are the same

    Hi, I have two sheets. In sheet B I got Name and Group at H2-I6 (blue image). In Sheet A I got Name and Group at A1-B5. What I would like to do is pasting the groups from sheet A to sheet B if the names are the same. For example. If Eric is found in the H column, the cell next to Eric (column...
  16. Z

    For/Next Loop Iteration Based on Specific Columns

    All, Below is the code I am working with Sub ExtractBST() Dim wsCopy As Worksheet Dim wsDest As Worksheet Dim lCopyLastRow As Long Dim lDestLastRow As Long Dim Current As Worksheet Dim I As Long Application.ScreenUpdating = False 'set variables for copy and destination worksheets Set wsCopy...
  17. T

    Searching names in a column and coloring them if they match in another column

    Hello. Sorry if my English is bad, I am french. I would like to compare a column of name with another column of names. I used a levenshtein code to have a percentage of similarity with the columns. What i want to do is like if the words are matching with a > 70%, it colors the name in green If...
  18. M

    Delimit and create a loop in VBA for a varible number in each row

    Hi there, I have a data set where in column J and K I have data which is separated by ; - the data which is A-I is relatable to what is in these columns. I would like to delimit that data in both these columns which will have the same number of data elements in each and then create a line for...
  19. B

    How to loop faster?

    i have a code when on cell change then loop and fine matching value. then offset and paste in cell to left. code works fine but need it to work faster. Any help would be appreciated. Sub Worksheet_Change(ByVal Target As Range) Dim KeyCells As Range Set KeyCells = Sheet1.Range("C2:C50")...
  20. T

    Loop cells to array

    I need to add values to array but I don't know how big range is. It depends of conditions in column J as you can see. Code below doesn't work. It doesn't add values to array it just makes new array everytime with single value which comes from column D. How to fix this to ADD new values to array...

Some videos you may like

This Week's Hot Topics

Top