loop and insert

  1. C

    Loop through range. Use range data as input

    I am struggling to add further functionality to my code. I would like for my code to run a loop through a range of dates, found in column "E:E", and thereby use this input into cell C2 and then perform the rest of my code - saving the file to CSV (SaveAsCSV()). The spreadsheet is such that it...
  2. R

    VBA to assign "id number" into all files in folder?

    Hi all, I am new to VBA but am learning, and have had some very useful help on here previously, I think what I am looking to do should be possible, but am not sure where to start. I have a batch of 600 files in a folder and need to assign a id/reference number (starting at #1261 ) in to cell...
  3. S

    Loop and Insert Row VBA

    Hello - I'm looking for some assistance, I have roughly 5000 rows of data and I need to insert a row between each of them. Basic Statement that i'm looking to achieve is: If Cell in column A has data, (Text, number, etc) then insert row beneath. Loop until cell with out data (text, number...
  4. J

    help to exclude a file

    Hey All, I have code that loops through excel files in a file folder and edits those files. My trouble is that the code is also editing the workbook where the code is saved. Can you take a look at this code and tell me how I can exclude my workbook from the editing loop? Private Sub...
  5. G

    Not able to loop for converting range into image

    Dear All, Please help me with a vba code to convert a particular range to an image through looping. I'm using the below code, however I'm not able to convert range into image through looping. I'm using excel and outlook 2016. Sub sendMailj() Dim TempFilePath As String Dim...
  6. C

    VBA to copy values between sheets skipping blanks

    Hello everyone! So just so everyone knows, I am a VBA newb, self-taught through extremely helpful forums like these. This is my first post and haven't even set up my profile fully. Lol This request will help me and my accounting team here at my job out tremendously! So, thank you for taking...
  7. S

    Insert Multiple Rows in loop

    Hello, I'm facing this problem of inserting rows in a loop. Your help are highly appreciated. Sub InsertMultipleRow() Dim i As Integer i = 6 Do While i < 100 Sheets("Sheet1").Rows("i:i").Insert Shift:=xlDown i = i + 6 Loop End Sub
  8. S

    Excel VBA to Loop

    Hello everyone, I need to make this code run as one. Thank you for your help. Sub InsertSaturday() Dim i As Integer i = 6 Do While i < 100 Cells(i, 3).Value = "Saturday" i = i + 6 Loop End Sub Sub InsertSunday() Dim j As Integer j = 7 Do While j < 100 Cells(j, 3).Value = "Sunday"...
  9. J

    optimizing vba looping code

    Sub Testingloop() Dim endrown As String Dim ex As String Dim ez As String Dim eh As String Dim eg As String Dim el As String Dim ee As String Dim es As String Dim ef As String Dim ei As String Dim i As Integer Dim LastRowColumnA As Long: LastRowColumnA = Sheets("looping").Cells(Rows.Count...
  10. J

    Working with a VBA array

    So I will do my best to write this out. Currently, I have a VBA loop that filters a range of cells looking for a color and then stores that cell reference. After that, I loop backward through the array inserting a row above it. For i = UBound(visibleRowNumbers) To 0 Step -1...
  11. S

    Compile Error: Expected end of Statement using SUM formula in variable range loop

    Hi there, New to this forum and I love it! I have searched and searched but can't seem to find an answer that resolves my problem. I am using a loop in a macro that groups and subtotals columns for data categories. The data the macro is run on varies greatly in size each time, but the...
  12. D

    VB Insert Coppied rows - VB Loop?

    Here is a screenshot of my workbook. http://my.jetscreenshot.com/20092/20160209-nszp-274kb What I am doing now is a manual process. I am copying the above Highlighted rows and then "Inserting Copied rows" under each row that is labeled "original row" to generate the required data in rows...
  13. J

    VBA Loop Evaluates Cell, Copy & Paste it above Current Row, If Criteria is met

    I'm a novice when it comes to VBA, and I have a list of names in Excel 2013 (Running Windows 8.1) and I want to write code that will generate and include all nicknames the person might have, so that if a user enters some variation - it will still be recognized. For example Richard would have...
  14. K

    How can I add another loop to insert worksheets based on a list?

    I want to add a loop that create worksheets with the same name on the list, if the workbook does not have the same named worksheets in a list. How would I add it on this code? Can anyone do it..? Sub DeleteSheet() Dim WS As Worksheet, SheetsToKeep As String Const SheetNameWithList As String...
  15. S

    Macro to loop through all rows of data

    Good Morning, I have created the following macro which is supposed to loop through all the data points and create Outlook calendar entries for each line of data in my Spreadsheet. At the moment it looks like it only enters the first line as an entry to Outlook before stopping. What do I need...
  16. R

    Loop through all worksheets in all sub-folders and enter name and number in A2 and B2 based on sheet name.

    Please help ! I want the macro to go through all the files in a sub-folder and look-up the file names mention in the another excel sheet "Sample 1", and open and paste the "name" in "A2" and "no" in B2. "Sample 1", A B name no. Central 5656 Sustainable...
  17. D

    Find Used Range & Enter Formula

    Hi, I'm using Excel 2013. I'm looking for a VB macro solution. I want to loop through all used cells in column H and enter a formula in each cell. The formula basically divides the figure in cell G with the figure in cell F. I think the formula should be ActiveCell.FormulaR1C1 =...
  18. A

    Add new row and Loop range data from previous sheet - vba excel

    I'm looking for the right code where Sheet2 will add a new row and populate the Column B cell of the new row with data from a range on Sheet1. I need this to occur every time I add new item to the range on Sheet1. So if I have: Sheet1: <code style="margin: 0px; padding: 0px; border: 0px...
  19. S

    Multiple loop inside one another

    Hi all Window 7 / excel 2010 Here comes my problem, I get workbooks full of data but not organised except for one thing the phone number is in the cell below the cell with the valuue "Phone" Currently I can retrieve each number in a sheet and create the list on the sheet 6. here is my code...
  20. S

    Adding Cells in Column O based on value on Column K

    I need help writing VBA code to add a cell within a column based on a value in another column. Basically, if cell "K2" is greater than 0, I want to run a code that would insert a blank cell into that same row (cell "O2"), which would shift the current contents in O2 downward. I would like this...

Some videos you may like

This Week's Hot Topics

  • Use Filter function with 2 criteria to return a specific value
    I've spent many hours trying to find out why the basic formula for Filter function with 2 criteria will not return a value other than #CALC. I'm...
  • Loop stopping at row 10
    Below is a code I had a lot of help with from user such as yourself. This code worked well but now is stopping a row 10 and I can't see why! Could...
  • Numerical Order Code for Macro
    I am trying to find a code or fix what i have on the macro that will automatically make the certain column generate in numerical order when I...
  • Calculate time in excel
    I get a text report from our time keeping system that i dump into excel through a data connection and I need to calculate the total hours for a...
  • VBA
    Hello everyone, I need your help please. I just need VBA code to get my reports working. What I want to do is whenever these dropdowns are...
  • Help with formula to sum numbers prior to date
    Hello, I was hoping to get some assistance as I'm having trouble with this. Using my table below as an example, how could I write a formula which...

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
Top