loop

  1. R

    Loop trough list by year and month and sum value into textbox

    Hi all! Stucked with adjusting a code that sums my hours. I use two codes to get the value of the sum hours. The first one checks if both cBoxes are set, the second one is called after the check for making the sum of the hours. The looped list is on the second worksheet. The dates I'd like to...
  2. I

    VBA Loop: Enter Value in a Cell then Save a Subset of Sheets as pdf

    Hi guys. This is my first post. I created an eternal calendar in Excel. I need to come up with a loop that would feed one of the cells with a specific starting year, let Excel do its thing, and then print the results as pdf file for each year. Leap years and common years would print from...
  3. R

    Need to Stop DoEvents Automatically

    Hi Friends, I wrote the simple code below to create a small animation (rotate a shape) and the shape is beautifully turning as expected. But my concern is, I need the automation to automatically STOP after 10 seconds. Or at least it should stop after I click on a message box or something like...
  4. FuNeS13

    Loop through column titles (1st row) if name is in array

    I know I'm doing something wrong in this part of the code, but I don't know what... Dim MyArray As Variant Dim found As Boolean Dim uB As Integer, lB As Integer Dim LC As Long MyArray = Array("Type", "Number", "Order", "Invoice Date", "Due/Paid Date", "Amount", "Shipment", "Customer"...
  5. drpdrpdrp

    How to make For Each Cumulative Sum more efficient

    Hi All, How can I make the following structure faster or simpler? Simple running cumulative sum of elements in an array returning an array of the same size. I've heard using For Each should make things faster but the lag I'm noticing with the structure below is noticeable on a few arrays per...
  6. S

    FindNext loop until next blank cell

    Hello, I am stuck on a simple idea but yet the code for it might not be that simple... I am a beginner at coding in VBA, and I am trying to create a sub that selects and paste the values of all the cells in a column that contains today's date when you close the sheet. Right now I managed to...
  7. MartinS

    Loop Using List of RegEx in worksheet

    I have a workbook 'tool' which needs to validate the names given to the files being output. The validation requires that, where the filename starts with 'ABC_', it should be one of a set of known syntaxes, i.e. ABC_2020_[MF]_(#_##%_S#_#_A#_##%_W#%) i.e. ABC_2020_M_(1_50%_S7_5_A0_25%_W1%)...
  8. A

    Excel VBA: Loop through autofilter problem

    Hi all, I want to loop through autofilter criteria in column G( below photo) and do something, such as copy or sum. How can i loop each choice in VBA? Thank you very much for your help.
  9. R

    comparing array - finding how many kits can be made from existing inventory

    Hi all, I have inventory stock details with 11,000 part count and I am making vehicle from this inventory. Now for one vehicle I require 1300 to 1500 parts with varying quantity on each part. there will be multiple vehicle codes I want to create a crisp VBA where it will show me 1) how many...
  10. X

    VBA macro to delete row if cell in Column A is empty

    How would I create a macro that loops through the current open sheet and deletes the current row if the cell in Column A is Empty?
  11. J

    Loop, calculate and copy results

    Hi everyone I am not very familiar with Visual Basic and need some help. I have a table that calculate costs and depreciations based on pre-selected inputs. The inputs are categorized according to the asset in question, numbered from 1-1.000 (representing 1.000 assets in total): Everytime a...
  12. E

    VBA to format border on every nth cell

    Hi, I have multiple data sets in columns A-G of 13 rows each, which are stacked on top of each other. The data sets are dynamic and there can be between 1 to 40 sets of data. The cells in the first row of the whole data set are headers. I currently have a macro that draws this data from the...
  13. W

    Loops with random number instead of sequential number.

    Hi Experts, will like to know if there is any way that i can do any loop without a fix sequence. For example: Sub Test For x = 1, 3, 4, 5, 11, 19 next x End Sub
  14. J

    Userform Loop

    HI, I'm trying to write a simple loop to pull data from my worksheet into a text box on my userform when I click a command button. The data is all in one column, but it could sometimes only be 3 rows, or 10. Once I get the data into the text box I want it formatted like this: "Data from...
  15. E

    Vba copy range of formulas, loop through sheet & paste them as values

    Hi Message Board. I originally posted this back in oct 2022 but never got any hits. Could any one help me on this? Just wondering if someone could help/point me in the right direction. Currently, i have some VBA code that copies a range of cells (Q5:DC5 (This the named range called Master_MRP))...
  16. JohnGow383

    Help with VBA for Looping through and using Countif

    Hi, Having trouble counting items in a table using VBA. I'll post a very simple example here to explain. I am trying to use VBA to count for each row all the cells with "x" in the above table, only when the cell in Col C = "A" Here is my code, but it's wrong of course. It is only counting...
  17. S

    VBA to EXTRACT & LOOP

    Guys I am Back ! I have tried CHATGPT to write the code but it is only stupid code that does not work. Now, my query is i need a code that needs to go to cell A31 then find "F57A" then find BKCH when it finds this then start extracting from BKCH till 11 digits only. Then skip to A68 and do...
  18. S

    Error when looping through Access queries "Too many client tasks"

    Hello friendly helpers, I have run into a problem when looping through Access queries via VBA. I have multiple levels that I am looping through; the first table (query) consists of unique project leaders, I then loop through these to find associated projects, after which i loop through the...
  19. larinda4

    Loop - Pasting data to the bottom of existing data

    I have part of my code below and it requires a little tweaking. Breakdown: I have two worksheets, one called PivotTable and another called PerC. In my PivotTable worksheet, there is a value in Q2 that generally changes every month. I want it to go through column J and find any values that are...
  20. VBA learner ITG

    VBA Formula to Check if the Range between blank rows are the same and loop

    Hi all, I need your advice if possible. I have a dataset which i am trying to determine between blank rows with variable blocks of data ranges in Column R to see if the numerical values are the same within the range and if the value are the same I want "True" and where its not exact "False"...

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