1. B

    How to Create a Loop to ignore BLANK CELLS

    Hello, I have a macro that does what I need it to do but if there is a blank cell it deletes it also. How do I add into this code a loop to ignore blanks? <>"" Sub DeleteDuplicates() Dim Rng As Range Dim SRng As Range Set Rng = Range("B3", Range("B3").End(xlDown).End(xlToRight))...
  2. D

    Adding the count of repeating values

    Hi everyone, I would like your help on figuring out an issue I am facing. I have built a macro, where I need to format the source data and map it and transfer it to a template. One of the fields I have to map requires that I put an underscore and a number after the record, the number being the...
  3. P

    Looping through text boxes and checkbox captions on a user form

    On a user form, I have 2 sets of 25 text boxes and 1 set of 25 checkbox named TextQty, TextPrice, CheckBox respectively. I am trying to pull the checkbox caption and the values inside the textboxes into a listbox if the checkbox is selected. I want to be loop through each set of the textboxes...
  4. E

    Iterate number only in certain row, within sets of rows

    I currently use the code below. I now have data in column H, so I have changed the range part to Range("A2:H3001"), as I want to iterate numbers in column H, too. However, this column contains different formulae in the rows, and I only want the script to iterate the number every 3rd row in each...
  5. E

    If cell in next month need to delete rows in table

    This code needs to delete any table rows which are next month. The Dims etc. are correct so i can`t workout why it`s not depleting the next month lines ?? With tblDailyMail.DataBodyRange For Rw = .Rows.Count To 1 Step -1 For Each Cell In .Range("A2:A" & LRow)...
  6. The Ruff Report

    Help with macro to loop through cells and save a file

    It's been awhile since I've created this macro and I'm having trouble. I have a workbook "Sales" with a worksheet "Names" that has 100 names starting in cell A1. I want to copy the name in A1, paste into a new workbook (it updates a bunch of figures), and save that workbook under that name. I...
  7. P

    Clear All Filters

    Hello, I need a loop VBA code to show all data from every worksheet on my workbook. The workbook is called Consolidated. I want to keep the filter so I can refilter later. Also, can you help with a loop code to refilter every worksheet as well? Thank you to anyone who can help me.
  8. V

    VBA Excel cycle through sheets, find last row in table and autofill with data

    Hello All, I need a script that cycles through all the sheets in a workbook and adds 2 (or more) columns at the end of the table of each sheet (except the first sheet). In this case I have a YES and NO column to be added. The added columns YES and NO need to be autofilled all the way down to...
  9. M

    Looping through various worksheets VBA

    Hello, I am looking to create a loop to run through all the worksheets in my workbook to run some code that clears the contents of "blank cells". The code works for the active worksheet but doesn't seem to run through the loop to the next one. Sub WorksheetLoop() Dim ws As Worksheet For Each...
  10. B

    How to reduce a repetitive macro (loop maybe?)

    Hi So, I have a macro that is repetitive with the only change is the name being searched. The macro works but I am limited on the number of names because I get an error message saying it is too large. Can someone help on condensing this maybe in a loop (not sure how to do that) Private Sub...
  11. R

    Apply color to shapes using the color of other cells

    Hi I'm trying to color shapes from the filling background of several other cells (themselves located on another sheet than the shape). The shape "Pa1" (located on sheet "gif") would successively have the color of cell A1, then cell B1, then C3, then A2, then B2, then C2, then A3, B3, and C3...
  12. 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...
  13. 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...
  14. 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...
  15. 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"...
  16. 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...
  17. 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...
  18. 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%)...
  19. 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.
  20. 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...

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