loop

  1. N

    Pasting Value with VBA - Sorta Looping based on a multiple of 30

    I want to create a VBA code that pastes different columns within a row to a pdf, then move to the next row and do this to 30 different rows. Then I want it to save the document then continue from where it left off. Therefore, after 30 rows have had their columns pasted into the text boxes within...
  2. WildBurrow

    Copy/Paste data to next empty row within a range - WITHOUT shifting subsequent rows up

    The worksheet in question is NOT a table. Some of my fields are merged and I am fully aware that I need to unmerge to copy/paste then merge after the code runs. My worksheet contains two sections which are restricted to a set number of rows for data entry. 1) Responsible Party Analytical...
  3. C

    VBA: open and copy data from multiple (txt. files) to excel

    hi, need macro to open and copy data from multiple txt. files (exactly i need direct 35 values(years)) to excel. I did macro for one year, but im struggling to do it for 35 years, can someone help me with solution please? Sub txt_to_excel() Dim X As Double Dim TXT As String ' Adresss Open...
  4. 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))...
  5. 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...
  6. 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...
  7. 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...
  8. 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)...
  9. 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...
  10. 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.
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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"...
  19. 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...
  20. 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...

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