loops

  1. M

    Loop through multiple columns and transposing data

    Hi there, I have some data which is in the below format. I'd like to manipulate this so it looks like the second table. However I'm having some trouble with my loop where I can only run it for client 1, and can't figure out how to add client 2 and 3 to the column K with the respective...
  2. J

    Optimising code to make it run faster by eliminating sheet access

    Hi all, I have some code that generates essentially a table of contents; lnRow = 6 Set wbBook = ActiveWorkbook 'Iterate through the worksheets in the workbook and create 'sheetnames, add hyperlink and count & write the running number 'of pages to be printed for each sheet...
  3. C

    VBA formula for sheet reference, with a twist

    Forgive my ignorance and my lack of vernacular. I'm very new to writing macros and coding. Everything I know today is self-taught and derived from forums, google, books, and whatever else I have been able to consult. I have a macro that loops to create a specific formatting for "events". It...
  4. H

    Loop through folders and execute code if folder name matches specified names

    Hello all, I am new to VBA coding. I had taken a programming course almost 6 years ago and never touched it since but I would like to start learning slowly to automate a lot of my excel stuff. I am looking for help to code the following the scenario: I have 10 folders in a particular...
  5. J

    Using for loops for lateral printout of data instead of vertical

    Say you have a for loop that posts stuff for each iteration into cells one below each other. That's pretty easy to do, with say "A" + i. How does one go about doing this with the cell letters, or in other words to put stuff into cells to the side using for loops? Cheers
  6. T

    Loop in VBA to restart formula until there is no more names in a list

    Hello, I have a very basic VBA code like as follows: Sub Hello() 'Removes any duplicates Columns("A:A").Select ActiveSheet.Range("$A$1:$A$27").RemoveDuplicates Columns:=1, Header:=xlNo 'Copies name from top of CE List into Input tab G12 Sheets("Names").Select...
  7. G

    Tips, Macros, Loops to begin Excel Consulting service as VBA beginner

    Hi I’ve used excel a lot throughout undergrad and graduateschool but never knew about VBA until after graduating. I used a lot of powerpivot and VLOOKUPS during an internship. Also, I use excel quite a bit in myengineering position and started taking courses online to learn VBA. My dad hasa...
  8. Russell Hauf

    M Loop that does its action on a table and returns table

    So I'm pretty new to M / Power Query, and I am trying to do something similar to this post I have a function that does operations on a table and it works, we will call it TableOps1. I'm trying to write TableOps2 that calls TableOps1 while there are still Lists or Records in my table (I also...
  9. F

    Extracting data based on Date.

    Im trying to to extract data and push it to another sheet based on date. The code I have works but only does column A and B when C and D has information in it also. Any help would be greatly appreciated thank you. Sub extractDataBasedOnDate() Dim lastrow As Long Dim erow As Long Dim i As Long...
  10. J

    Why would my macro be repeating itself?

    I have a macro which loops through most of the dozens of sheets in the workbook and checks to see if the selected range of cells is wider than a single column and contains 0 blank cells. If these are true it copies the selection to the "uploader" tab. This macro had been working properly for...
  11. S

    Compile Error: For Control Variable Already in Use

    Greetings, I am receiving the compile error "For Control Variable Already in Use". I have nested For Each Next loops with the Control Variable as "Row". I am looping by the row with a predefined range of rows. How can I maintain the nested loop structure and use a variable that loops using a...
  12. J

    Assigning values to variables in a loop

    I am not well versed in loops, so please bear with me. In A1:A20 there is a list of PO numbers of variable count, i.e., there could be one PO, twenty POs, or any number inbetween. I have 20 variables declared. PO1, PO2, ... PO20. I also have POCount declared and assigned the count of...
  13. D

    Looping from bottom to cut/paste varying length sections of column to next available column

    Hey Guys, I've been trying to figure this out but could really use some help. I have an output file from a machine that comes in a long list in column A. I'm trying to write a vba macro that goes through the list and moves a varying length section (based on header) to the next available row...
  14. S

    Adjust Chart for all WorkSheets VBA

    I want to be able to copy and paste an Excel Chart using vba to set number of worksheets, but to adjust the range for the charts to that particular spreadsheet, this how far I've gotten but I have an error Sub CopyCharts() Dim Wkb As Excel.Workbook Dim ws As Worksheet Dim ws_count As Integer...
  15. S

    Finding common values in 2 ranges using nested loops

    I’m going around in circles with this one. I have a list of unique names in cells K2:K21. In the same sheet, I also have multiple examples of these unique names in two columns, cells (C2:D92) that I want to summarize next to these unique names in cells L2:R21. What I am trying to do is start...
  16. S

    More efficient/effective solution needed for loop

    Hello! You'll be able to tell by this post, but I'm a beginner at VBA programing. I wrote the following code with this intention: One workbook with two worksheets. The first worksheet has a list of names, and the second sheet is a formatted document. The code would go to the first name in the...
  17. N

    How to automatically label data point at intersection of plot?

    Hey Everyone! I currently have a loop running in VBA that requires inputs from a user, and then provides data and a plot. Essentially this is a break even function. The plot consists of 3 horizontal lines (will be the same in every plot) , and a linear function (changes based on user input). I...
  18. K

    Does not Loop like it is supposed to

    I have the following code and I want it to loop through all sheets in the workbook except a sheet called "Summary". Here is the code: Sub DragSort() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets lastrow = Range("A3").End(xlDown).Row Range("H3:I3").AutoFill...
  19. J

    VBA Select open workbook

    Hi, I'm having an extremely frustrating time just selecting on open workbook to copy and paste information. The workbook I want to select is the workbook running the macro - the macro opens other workbooks, copies data from those workbooks, and pastes into cells in the workbook running the...
  20. N

    Array Loop Help

    Greetings! Long time reader, first time poster. I'm sure there is an answer to this question somewhere but I have spent hours reading trying to find a solution and still cannot find it. Any help will be greatly appreciated! Thanks! Goal: Use a For Loop to loop through an Array of Sheet Names...

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