looping

  1. R

    Looping problem that make procedure too long

    Hi. Appreciate any solution to this looping problem. I can't run the VB macro code due to procedure too long. The looping as below: n = 5 For j = 5 To 7 Sheets("A").Cells(j, 121) = Sheets("A").Cells(5, n) n = n + 1 Next j n = 5 For j = 8 To 10 Sheets("A").Cells(j, 121) = Sheets("A").Cells(6...
  2. A

    Looping file range

    Hello all, I'm trying to figure out how to do this properly, but making functional loops seems to be my VBA Kryptonite. I have this code: Private Sub CommandButton2_Click() Sheets("Summary").Range("A1").Value = FEP.TextBox1.Value AllBanks End Sub that takes the number entered into the...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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")...
  8. 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...
  9. 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...
  10. 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...
  11. Phil Smith

    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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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) =...
  19. 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...
  20. 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...

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