looping

  1. H

    Looping, and moving Data by criteria to a second workbook

    I am trying to Loop though a list of a data. For every column where L is left blank, I need to copy column A:K of that row to a second workbook. I know in need to make the range to be copied and where it should go on the second workbook dynamic. But I am struggling with getting to work. Below...
  2. J

    how to shorten this one ??

    Private Sub awp() Set wks = Sheet9 If wks.Range("I3").Offset(0, 0).Text = "Yes" Then obYes.Value = True ElseIf wks.Range("I3").Offset(0, 0).Text = "No" Then obNo.Value = True ElseIf wks.Range("I3").Offset(0, 0).Text = "N/A" Then obNa.Value = True End If If...
  3. ACommandLineKindaGuy

    How to copy a picture from one shape to another

    I would like to replace 45 icons looping n = 1 to 45 using Worksheets("Print Label").Shapes.Range(Array("Icon " & n)) with another picture Worksheets("Print Label").Shapes.Range(Array("Choice")) I tried using the macro recorder to copy the selected shape and then right-click on the shape to be...
  4. G

    Loop not Looping!

    Hi All. Can anyone see anything obvious why the loop part of this code if not looping. Its doing everything it should except its just displaying 1 rather than 1 to 13 (TMs). Sub tagteamallocate() If Sheets("Calculations").Range("AX18") > 0 Then MsgBox "There are unrecognised room types...
  5. H

    Looping and Repeat Proceedure

    Hello everyone. I need help figuring out how to repeat a procedure I created. Here’s the code: Sub osvPrint() Dim osv As Worksheet Dim vosv As Worksheet Set osv = Sheets("OSV") Set vosv = Sheets("vosv") vosv.Shapes("Textbox 5").TextFrame.Characters.Text = osv.Range("D5")...
  6. C

    VBA Looping Presentation

    Dear Excel Wizards, I am currently a student taking my first class on visual basic. Our class's first project is to create a looping presentation using VBA. Basically, we need to write a code that uses the Loop until function. It is a very open ended question and it is open to creative minds...
  7. M

    Referencing a worksheet using variable name from array

    Hello, I am new to the forum and a relatively new beginning VBA programmer in Excel. I have done a lot of looking through various forums and thought I found some code that I could adapt to a project I am working on. The code I am looking for will loop through an array of worksheets and perform...
  8. S

    loop through records in an Access form

    I literally did this 15 years ago in Access, but have forgotten. I have a form connected to a table. I want code that will simply look at the filelds in the table, loop through them so that I can run a report for each records. Here's the order I want to do things in. Store 1 is in the form A...
  9. P

    Find cells with a given value and copy the two cells to the left...

    On my worksheet "Roster", I need to find which cells in columns I, M, Q, U & Y contain "SP". At the moment I am looping through I2:I71, M2:M71, Q2:Q71, U2:U71 and Y2:Y71. For example, the first cell that contains "SP" is I9. I would then need to copy G9:H9 and paste those values to cells...
  10. S

    Macro needed to fill cells based on another cell value in a different sheet

    Hi guys, if anyone can help me get the macro for this to work, it would be amazing! My VBA is lacking a little and am losing my head over this - any help would be greatly appreciated: 'if any cell value in range L3 to P73 is = 2 in the OLD v New Check Sheet 'then find corresponding cell in...
  11. L

    VBA Loop with multiple conditions on one sheet

    Not sure if this is a duplicate question but couldn't seem to find it anywhere. I have the following sample data: <tbody> A B C D E F G H I 1 EMPLID NAME Dept LOC JOB TITLE EE STS EFFDT HIST EFFDT HIST EE STS 2 123 Doo, Scooby 564 564C Driver L 4/28/2018 3/20/2017 L 3 123 Doo, Scooby...
  12. F

    looping through subdirectories in a zip file vba

    Hi I'm trying to loop through all the files in a directory, including subdirectories and copy anything that has the word 'spec' in it to another location. It work fine until I come across a zip file, which has subdirectories in it. Does anyone know how I loop through files in a subdirectory of...
  13. T

    Searching for specific words in the string data with VBA

    Hi, I wrote the following code to loop through data column for keywords such as "personal" or "fraud" and copy rows with these keywords to a separate tab. The problem is that my code does not work when the keyword is within the phrase (i.e. "personal expenses"). Is there quick fix for that...
  14. R

    Looping VBA with Substituting Format

    I wonder if you can help. I'm looking for some simple VBA to allow me to loop through column A in a worksheet. If the cell in column A contains any data, then format its adjacent cell in column B. Also, should that adjacent cell in column B 'not' have any data to format, then continue to loop...
  15. S

    Looping In VBA Please help

    I Have the below VBA code but i cant get it to loop every time, until "rFound" is noting, also how do i change "Const FlName" so that it would save in the same file directoy as the xlsm file but everytimes it loops i want the txt file it creates to change its name in consecutive order e.g. chunk...
  16. M

    Looping Through Frames Looping through Option Buttons

    Hi all! I am relatively skilled with VBA but cannot find a better way to do this... I have a userform with 63 frames. Currently I'm transferring my data out with 63 iterations of the following: For Each ctrl In Frame1.Controls If ctrl.Value = True Then home.Offset(j, icol) =...
  17. R

    Macro for looping through cells and copying out values based on the value being isnumeric or not

    Hi I need to loop through a column and based on whether the value starts with a number, copy this value to the cell to the right of it and append any cells below it which are not numeric and then repeat when you find a cell where the first value is numeric again... to get the results as per...
  18. D

    Coding help please - Looping through drop down lists and copy/pasting contents into new workbook, saving

    Hello, My first post, please be nice My coding skills aren't great, but otherwise very well skilled in Excel. Hoping somebody can help, I'm stumped. I have a workbook with tables and charts that are populated from another worksheet (in the same workbook) using lookups. There is a...
  19. D

    Vba to cycle through sub folders and perform functions on excel files

    hi everyone, I have a folder with subfolders that have excel files in them. I am trying to have a vba loop go through each of the sub folders, extract the value from Cell F1 from a specific sheet and then paste that value into another workbook. a couple of roadblocks: 1.) each folder has a...
  20. J

    Macro Loop through cells in column

    Have a column C with a lot of data. Many of the cells contain spaces in the end. I want to trim each cell by using a macro looping through each cell. I want to practice looping. Is it possible to write a code which loops through each cell and removes the space(s) in each cell. Thanks.

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top